Jithin Kuriakose
Jithin Kuriakose

Reputation: 121

How to play DTMF tones in android via headphone programatically?

I am currently working on a car security system....

I need to produce DTMF tones via the headphones of the phone that makes an input to the external digital circuit. Is there any API to do this? Canany one helpm....

Thanks in advance...

Upvotes: 6

Views: 2607

Answers (1)

Jithin Kuriakose
Jithin Kuriakose

Reputation: 121

I got the Answer....Its very simple....

http://developer.android.com/reference/android/media/ToneGenerator.html

ToneGenerator dtmfGenerator = new ToneGenerator(0,ToneGenerator.MAX_VOLUME);
dtmfGenerator.startTone(ToneGenerator.TONE_DTMF_0, 1000); // all types of tones are available...
dtmfGenerator.stopTone();

Upvotes: 6

Related Questions