That's what I'm doing:
private SoundPool pool; private int soundId; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
Initially, I used a WAV file for a click sound, and the problem would have occurred in 90% of cases. I added setLoop and it seems to have reduced it a bit.
I thought it might be a problem downloading .wav files, so I converted the file to .mp3. Now the problem occurs in 5% of cases, but it still occurs. I built with and without calling setLoop, and it seems that including it helps a bit.
As you can see, I added a debug log message to make sure that I don't accidentally call the play function twice. According to the log output, the sound is played only once, but I hear the sound twice.
I also used several different sound files. Some of the files seem to be repeated more often than others. I see no correlation, except when it happens more often with .wav files.
I see that the problem on Samsung Continuum is running 2.1 (minimum and target API: level 7). I did not have any additional cycle with any applications on the market that I downloaded on one device. Unfortunately, I do not have other devices for testing.
I just found another person experiencing this problem, and he or she also used a Samsung device.
Here is a link to another problem:
https://stackoverflow.com/q/4873995/695336
At this point, I think Iβll try to build the releases to see if this is all happening and then maybe convert to .ogg format. After that, I will probably try switching to MediaPlayer to see if I get the same results.
Thanks for your help.
android audio
pinkonion Apr 6 2018-11-18T00: 00Z
source share