I had a few performance issues while using SoundPool. Everytime I played a sound, the frame rate dropped. This is absolutelly inadmissible for games requiring a high FPS rate.

I’m using *.ogg files and the SoundPool initialization is done during the game startup. I tried to play the sound on the game loop, on another thread and through a service and they all showed the same frame rate drop.

There is a basic example below:

After a few tests, I noticed that sometimes the “play” function took 8ms to execute and sometimes it executed instantly.

Then I did two more tests:
1) play the sound on 1000ms intervals -> the lag always happened
2) play the sound on 200ms intervals -> the lag never happened

Conclusion, it seems that when there is nothing playing, SoundPool is resetting and when it is going to play again, it takes time to initialize.

I solved this issue by playing a muted sound in loop and the lag never happened again!

If you have a better solution or a better explanation, please comment below!