Code example for SoundPool

Methods: play

0
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    } 
 
    public void onUntanButton(View v) {
        mSoundPool.play(mSounds[0], 1.0F, 1.0F, 0, 0, 1.0F);
    } 
 
    public void onUntanHighButton(View v) {
        mSoundPool.play(mSounds[0], 1.0F, 1.0F, 0, 0, 2.0F);
    } 
 
    public void onUntanLowButton(View v) {
        mSoundPool.play(mSounds[0], 1.0F, 1.0F, 0, 0, 0.5F);
    } 
 
    // ホームボタンで閉じて戻ってきた時に 
    // MediaPlayerを正しい状態にしてあげるため 
    // onCreateではなくonResumeで準備する 
    @Override 
Contextual code suggestions in your IDE  Get Codota for Java