I have a situation where my program needs to do something when it hears a certain sound. I have the exact .wav
file that will be played but have no idea how to make the program listen for it to be played. I've looked it up but I cannot find anything on this matter at all.
Asked
Active
Viewed 563 times
0
-
http://dsp.stackexchange.com/questions/14183/how-to-analyze-audio-input-spectrum-correctly, – Stefan Dec 07 '15 at 09:25
-
It's very difficult, maybe you can find a program that does this for you? The sound once played is completely different once you pick it up again with a microphone. So you have to analyze the microphone input continously in search for a similar sound signature. And that means you need a lot of dificult to understand mathematical formulas that need to be applied to randomly looking bits that come in from the microphone until the algorithm finds bits that it thinks sound similar. http://stackoverflow.com/questions/11988052/java-comparing-two-audio-files-to-see-if-they-are-the-same-music – zapl Dec 07 '15 at 09:33
-
@zapl What do you mean by microphone? This would all be taking place within the computer, no input from the microphone. – Hatefiend Dec 07 '15 at 09:38
-
ok, there is an usually an internal sound source where the computer can listen to itself. Still not easy because you would still have to analyze sounds: http://stackoverflow.com/questions/6326085/java-get-current-computer-sound-output- can't you signal your program in a different way that it should act? sound once processed into whatever the soundcard outputs is no longer identical (it could be if you have 0 processing and your sound is exactly the right bitrate and such) – zapl Dec 07 '15 at 09:42
-
@zapl Okay what about making it so the program will trigger if it hears ANY loud sound. I can control the volume of the sounds and though it may have some false positives, it's better than nothing. How could that be done? – Hatefiend Dec 07 '15 at 10:06
-
In that case you can record the internal audio and look for large (positive as well as negative) values: http://en.flossmanuals.net/pure-data/ch003_what-is-digital-audio/ – zapl Dec 07 '15 at 11:35