Question

I want to process DTMF code produced by other phone in real time. If one phone sends #1234 using ToneGenerator I want it to decode to #1234 in receiving app. How should I go about it?

Was it helpful?

Solution

You could use an AudioRecord to record audio from the VOICE_DOWNLINK AudioSource, then perform a Fast Fourier Transform on the recorded audio to split it into different frequency "bins". From that information it's possible to guess if a given tone is being played (e.g. if there a lot of energy at a specific frequency but very little energy elsewhere in the frequency spectrum).

There's a project at Google code called dtmf-decoder that attempts to do just this. I haven't used it myself so I have no idea of how well it works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top