Convert sound to code

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?

Any advice is appreciated.
Code's good enough, but creating an algorithm to recognize specific sounds may be quite hard.
You can modify this program:

Read more about DSP to do what you need.
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.)


Speech recognition

CMU Sphinx

Speech Technologies

Recognizing Speech
(in Objective C)

How to use speech recognition in Windows 7

Set up Speech Recognition

Common commands in Speech Recognition

List of speech recognition software
Last edited on
What library do you recommend? Aquila 3.0 or SPUC? Or something else?

The sound recorder was very interesting, but not quite what I was looking for. But it does contain some crucial points.

EDIT: Grammar
Last edited on
Aquila 3.0 or SPUC are DSP lbraries, not speech recognition libraires.

Did you want to implement your own speech reconition functionality using a DSP library?

Or use a speech recognition library?

Last edited on
I didn't see your answer until after whriting my own, sorry Andy.

The program I'm planning on should recognize musical tones, not voice. It's supposed to see if the key stroke is accurate, and what key is being stroked.
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
Last edited on
Thank you. I will give it a try, but if its to complicated there will be nothing to show. :)
Do you know about FFTs already? Or are learning about them for this project?

Topic archived. No new replies allowed.