I am developing a software that captures outgoing sound (speaker) and identify if there's any dtmf tones. I used NAudio to capture sound into a form of byte array. I want to detect if there's a dtmf tones on those byte array. I already googled it and i haven't found any solution that is close to my problem. Tapiex (or any commercial libraries) is not an option since i preferred an open source solution.
Asked
Active
Viewed 938 times
1 Answers
1
Do a frequency analysis and look for the two peaks indicating the correct key (see Wikipedia for the exact frequencies used; ignore the 1633Hz column for most uses). Make sure the tones last for at least 100ms before you accept them.
For frequency analysis, see this StackOverflow question.
-
I'll check the link you provided, thanks. But one more question, when you said "look for two peaks indicating the correct key", did you mean, for example, check if 697 and 1209 exists on the byte array if i'm looking for a dtmf 1? – jerzzz052888 Mar 06 '14 at 03:00
-
You won't be able to use the byte array directly. It'll probably need to be converted to float[]. Then you'll have to calculate the dB values for each frequency you care about. If you use the algorithm the other question I linked to, you'll have to run it for each frequency you care about and use the results from it to determine the key being played, if any. – ioctlLR Mar 06 '14 at 12:57