user1194823
user1194823

Reputation:

Playing default sounds

Is is possible to play the keyboard default sound without knowing the Android Version or the path to the sound.

The sound seems to change depending on the version of Android being used.

Upvotes: 1

Views: 325

Answers (1)

Kuffs
Kuffs

Reputation: 35661

private void PlayKeyPress (Context c){
    AudioManager am=(AudioManager) c.getSystemService(Context.AUDIO_SERVICE);
    am.playSoundEffect(AudioManager.FX_KEYPRESS_STANDARD, (float) 0.5);
}

Upvotes: 3

Related Questions