Example usage for android.media AudioManager playSoundEffect

List of usage examples for android.media AudioManager playSoundEffect

Introduction

In this page you can find the example usage for android.media AudioManager playSoundEffect.

Prototype

public void playSoundEffect(int effectType, float volume) 

Source Link

Document

Plays a sound effect (Key clicks, lid open/close...)

Usage

From source file:Main.java

public static void playKeyPress(Context c) {
    AudioManager am = (AudioManager) c.getSystemService(Context.AUDIO_SERVICE);
    am.playSoundEffect(AudioManager.FX_KEY_CLICK, (float) 0.25);
}