I've been using SoundPool since Android v1.0 and am happy that some of the problems were fixed, but I've noticed that it's still not entirely stable. As far as I know, there are still 3 major bugs with it (2 dealing with looping sound):
1) SoundPool.stop() is unstable/unusable. To reproduce, just set the max streams to 1, load up a bunch of small OGGs then play a few of them looping, then stop a few of them. Maybe 4 or 5 at once will cause it to totally lock up, never returning from the stop() invokation. My workaround is to set the loop to 0 and the volume to 0, which will cause the track to stop as soon as the loop finishes. Works well enough, but must be a pain for new developers to figure out! 2) SoundPool requires a reboot of the phone if the app crashes during an infinitely looping sound. This is a big, bad problem for those of us who have motor sounds in games. I have spent so much time testing and polishing the game to make it ultra stable, yet there still appear to be times on new devices or otherwise with X factors that cause the game to crash in-play, which results in a never ending loop of motor noise that can only be stopped by rebooting the phone. The only workaround is to use a high number of loops, but that opens up the potential for the sound to just stop in game, which isn't good either. Also, too high a number and the soundpool will continue to make the engine sounds for however long after the game crashed. There's no really good way to set it that I've found. What I'd like to see is that when a process using soundpool exits for any reason, the sounds are all automatically stopped. That's the expected behavior but it doesn't happen. This is one of the few areas of android where it's possible to leave an artifact (looping sound) on the system after killing a process. 3) SoundPool doesn't respect silent mode. Shouldn't it? I've been receiving bad feedback on the Light Racer games lately because of these problems. I really thought that SoundPool had been stabilized but my testing is showing otherwise. Please, please look into fixing these problems in a future release. To do variable rate loops for motors, we either need to use NDK and write our own audio processor or use SoundPool. MediaPlayers aren't suitable for triggered noises or variable rate engines. If any Google dev wants help reproducing these bugs, I'll be happy to put together a project that can crash an emulator and a G1 with ease. Just email me for assistance. Thank you! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

