nit icon indicating copy to clipboard operation
nit copied to clipboard

Android / sound: the fist sound.play does not play

Open privat opened this issue 8 years ago • 2 comments

privat avatar Sep 18 '15 20:09 privat

can't reproduce :(

BlackMinou avatar Oct 13 '15 12:10 BlackMinou

I've encountered this issue in sputnit. It looks like the lazy loading is not viable on Android. The sound is loaded in the background, so a play right after loading from the SoundPool may not yet have data available. The SoundPool Java doc says something about that:

[SoundPool.load()] should typically be done early in the process to allow time for decompressing the audio to raw PCM format before they are needed for playback.

There's a workaround, explicilty load all sounds at on_create: https://gitlab.com/xymus/sputnit/commit/521071af1d0

xymus avatar Aug 28 '16 16:08 xymus