0
sound1= sounds.load(getApplicationContext(),R.raw.sound1,1);

Here is a function that want to play a sound when the button is clicked.

public void playsound1(View v ) {
 sounds.play(sound1,1.0f,1.0f,0,10f);
}

But i don't know why it does not working?

Android
  • 1,420
  • 4
  • 13
  • 23
  • This may helps you, https://stackoverflow.com/questions/17069955/play-sound-using-soundpool-example – Android May 17 '19 at 12:48

1 Answers1

0

In your code look above your method. You must have forgotten to put the } symbol to close the method right above.

  • Here is just a part of my code.... it is not the whole code, but i dont miss any } trust me, i dont know why my code is giving me a lot of errors because is the one and only because there are 9 methods playsound1 ... 9 and to all of them is a problem – Bota Rafael May 17 '19 at 13:27
  • Try formatting the code properly, you'll probably find what's missing pretty quick @BotaRafael – Ferdz May 17 '19 at 13:55
  • In android studio is formated good bro, but i dont know why it is not working.... maybe some teamviewer will help me if somebody is available to help – Bota Rafael May 17 '19 at 14:08