How to play user dial pad tone on my custom keypad press in android?

Viewed 1918

In my app, I have a custom key pad and want to play tick tone on key press. The below code is giving me the sound.

AudioManager am = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
float vol = 1f; 
am.playSoundEffect(AudioManager.FX_KEY_CLICK, vol);

But I am looking to play the same tone which comes when user touches dial pad. How do I achieve it?

1 Answers
Related