Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sound effects on button click

Tags:

android

Is there any easy way to put sound effects within an onClick method when the user clicks the sound effect will make a sound. :)

I have looked into this but cannot find anything useful.

Thanks

like image 512
Tommy Avatar asked Mar 08 '11 18:03

Tommy


People also ask

What is the sound of click?

The click noise occurs when the tip of the tongue is lowered. Other click sounds differ in the positions of the tip and blade of the tongue and in the manner of the release of air into the mouth cavity.


1 Answers

You can use a SoundPool, look here: http://developer.android.com/reference/android/media/SoundPool.html

Load the sounds you need into your SoundPool and then use the play() method.

like image 71
Stefan H Singer Avatar answered Oct 11 '22 10:10

Stefan H Singer