identifying the DTMF tones in android

风流意气都作罢 提交于 2019-12-10 21:43:07

问题


I m planning to create a centrex system app in android. In which there is a voice mail will set in the receiver side. By the instructions in the voice mail, caller has to press the number in the dial pad, receiver side should identify the number and do the corresponding actions. Does anyone have any idea about how to detect the number pressed by the caller in receiver side?, What is the technology behind it?, Is it possible in android?

Any help will be appreciable..


回答1:


Decoding DTMF is rather simple since it was MADE to be decoded. You would Fourier transform the audio stream, getting frequency distributions. These can be matched to the well-defined DTMF frequencies. You can look them up on Wikipedia. Incidentally, that page also links to the Goertzel algorithm for DTMF decoding.

For identifying seperate pulses you can either segment the audio stream on silence or just choose segments that are short enough and try to patch up the data afterwards.The most challenging thing here might be detecting multiple instances of the same number.




回答2:


Does anyone have any idea about how to detect the number pressed by the caller in receiver side?

You need a DTMF detector/decoder. It is a fairly well researched topic, you can Google it. Imperfect implementations are easy to do (for example, 8 Goertzel filters) and work for most cases. Standard-level quality implementations are much harder, but you don't really need those.

What is the technology behind it?

Multi-tone detection. It is an interesting subject to explore. Even modern data transfer, like, ADSL builds on it (much more advanced than DTMF, though). But, for your purpose, a simple "filter bank" should do.

Is it possible in android?

Of course, you just need to get your audio data (samples) and feed them to your detector. How you get your samples depends on how you get your voice. In Java, you would probably use MediaRecorder API, and MediaRecorder.AudioSource.VOICE_CALL to identify you want audio from a call, rather than the MIC(rophone).



来源:https://stackoverflow.com/questions/16292934/identifying-the-dtmf-tones-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!