I want to detect claps sound instead of whistles

428 views
Skip to first unread message

Westporch

unread,
Jul 4, 2014, 8:15:28 AM7/4/14
to music...@googlegroups.com
Hello.
I keen to study WhisAPI Demo app for detect claps sound (mewing, baby crying etc).
so I found a WhistleApi.java file.
(https://code.google.com/p/musicg/source/browse/src/com/musicg/api/WhistleApi.java?r=f2fbf166a1d95059650274d6ee668ec08fec03cf)



package com.musicg.api;

import com.musicg.wave.WaveHeader;

/**
 * Api for detecting whistle
 *
 * @author Jacquet Wong
 *
 */
public class WhistleApi extends DetectionApi{
      
        public WhistleApi(WaveHeader waveHeader) {
                super(waveHeader);
        }

        protected void init(){
                // settings for detecting a whistle
                minFrequency = 600.0f;
                maxFrequency = Double.MAX_VALUE;
              
                minIntensity = 100.0f;
                maxIntensity = 100000.0f;
              
                minStandardDeviation = 0.1f;
                maxStandardDeviation = 1.0f;
              
                highPass = 100;
                lowPass = 10000;
              
                minNumZeroCross = 50;
                maxNumZeroCross = 200;
              
                numRobust = 10;
        }
              
        public boolean isWhistle(byte[] audioBytes){
                return isSpecificSound(audioBytes);
        }
}

[Question 1]
How do you determine the value of variables in the init()?

[Question 2]
What is the meaning of highPass, lowPass, minNumZeroCross, numRobust?

[Question 3]
If the app detect claps sound, replace the value of variable with relevant to claps sound value.
Is it right?


Sorry for my bad english.
Thanks you in advance.

fantasy sphinx

unread,
Jul 15, 2014, 10:24:21 PM7/15/14
to music...@googlegroups.com
Hi

i am also a beginner and trying to understand the code. i did a comparison of whistleAPI and clapAPI and indeed the difference is in the init part so i assume if u change the values u will detect other stuff..though the problem is how do we know exactly what value to use.

    protected void init()
    {
        minFrequency = 600D;
        maxFrequency = 1.7976931348623157E+308D;
        minIntensity = 100D;
        maxIntensity = 100000D;
        minStandardDeviation = 0.10000000149011612D;
        maxStandardDeviation = 1.0D;
        highPass = 100;
        lowPass = 10000;
        minNumZeroCross = 50;
        maxNumZeroCross = 200;
        numRobust = 10;
    }

as we can see values such as deviation, numZeroCross, numRobust change

Hyun-Gwan Seo

unread,
Jul 16, 2014, 3:13:47 AM7/16/14
to music...@googlegroups.com
Hello!!!!

Thanks fantasy sphinx. :-)

mewing, baby crying... I'm not found values.

I created CarApi.java that recognize the carhorn.
But, my CarApi also recognize the other sounds(for example whistles)

I guess that make other functions to capture the carhorn.(Beep!!!~~~ Beep!~~~~~~)
How about DetectDecibel()??? 
Carhorn is about 110dB In my country (Rep.of Korea) so I'll capture the around 100dB sounds.
But This method is insufficient to exactly detect carhorn. :-(

I continously find the perfect solution to detect carhorn.

Thanks.


--
這是 Google 網上論壇針對「musicg-api」群組發送的主題訂閱通知郵件。
如要取消訂閱這個主題,請前往 https://groups.google.com/d/topic/musicg-api/UTcP4u2BEJA/unsubscribe
如要取消訂閱這個群組和所有主題,請傳送電子郵件到 musicg-api+...@googlegroups.com
如需更多選項,請前往:https://groups.google.com/d/optout



--
mobile: +82 10-4011-1905

ladya...@gmail.com

unread,
May 1, 2017, 11:09:57 AM5/1/17
to musicg-api
Hello. please i am working on a mobile app project for babies and was wondering if anyone here could help with a  source code for detecting baby cry and alerts a parent. thank you

ladya...@gmail.com

unread,
May 1, 2017, 11:11:22 AM5/1/17
to musicg-api
or if i could just get an api for detecting baby cry? thank you


On Friday, July 4, 2014 at 12:15:28 PM UTC, Westporch wrote:
Reply all
Reply to author
Forward
0 new messages