I am using the following code:
button.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
AudioAttributes at = new AudioAttributes.Builder().setContentType(AudioAttributes.CONTENT_TYPE_MUSIC).setUsage(AudioAttributes.USAGE_NOTIFICATION).build();
SoundPool sp = new SoundPool.Builder().setMaxStreams(2).setAudioAttributes(at).build();
int sonido = sp.load(reserva.this,R.raw.sound_gracias,1);
sp.play(sonido,1,1,1,0,1);
}
});
Problem:
When i click the button, i can´t hear any sound (I have multimedia sound at 100%).
This is the sound i am using:
https://freesound.org/people/HoseNoseSounds/sounds/510735/
What can i do to solve this?
Thanks you so much for reading!