I want to create a program that listen to a sound, and if its a certain sound, do something.
What would I need to create such a program? Any special equipment, or is it possible to create all I need using code?
Were you wanting to write your own "sound listening" routines? Or would a library you can use in your program be ok?? If the latter, then there are open source libraries like Sphinx. Or with Windows and OS X you can use the system provided speech recognition functionality.
And when you talk about a "sound" causing a program to do something, as you talking about voice commands?
With Windows, voice commands are one of the Ease of Access (accessibility) features. To switch the feature on (in Windows 7) then use:
Start > Control Panel > Ease of Access > Speech Recognition
The system will then forward standard commands onto your program without it having to know how to recognize speech itself.
I don't know the details of how to enable this feature on OS X or Linux, but it os definitely possible (OS X has built-in support, but Linux will prob require a suitable library to be installed.)
Ah, ok. In that case a DSP library does make sense.
I've had a go with myself, using an FFT approach, but I used my own implementation of the Cooley-Tukey algorithm (which I had coded before for other reasons.)
I didn't get any further than recognizing the pitch of notes in single line melodies. I was only giving it a quick go, and while I did look into beat and envelope detection algorithms I didn't actually go on to implement any of them.
If you want to go on to analyze the dynamics as well as the pitch and timing, it's going to get quite involved!
PS Checking my notes, I see a number of links to posts at dsp.stackexchange.com