문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top