I everyone, I'm trying to make a simple piano application, for each note I have a .wav file and I'm using soundpool class to make It play.
BUT
On a couple of Xiaomi devices and on Asus zenfone a kind of white noise is all I can hear and it's very annoying, also despite my effort I couldn't find any solution on the web, help me please!! ))
Here my declaring of aAttributes and soundPool objects in class scope:
private SoundPool soundPool;
private AudioAttributes aAttributes;
volumeNote = 1.0f;
volumeFeedBack = 0.6f;
here the code on onCreate method:
aAttributes = new AudioAttributes.Builder()
.setContentType(AudioAttributes.CONTENT_TYPE_MUSIC)
.setUsage(AudioAttributes.USAGE_GAME)
.build();
soundPool = new SoundPool.Builder()
.setMaxStreams(10)
.setAudioAttributes(aAttributes)
.build();
here an example of the code on the onClick method:
case R.id.btFaLow:
soundPool.play(faL,volumeNote,volumeNote,0,0,1);
break;
I hope these information can help to find the issue. Thank You all in advance!