I've got an app on the Android Market and have been using the SoundPool classes for the sound effects. I've noticed that, of all the parts of the Android API, this seems to have caused me the most problems. For example:
HTC Desire has problems playing WAV files (this causes it to lock up randomly). Using .ogg files fixes this
On the Droid, if you exceed the number of channels in the init setup call:
mSoundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 0);
the handset would lock up. If you can imagine the difficulty in debugging that! On a handset I don't own. It required a lot of selfless help from my customers. Changing the '4' to '16' eliminated the problem. I have no doubt that if 16 sounds were played simultaneously it would still crash. Thankfully the chances of that are low.
- Also getting random crashes on various devices. I have got a catlog from one of my customers which has 'Heap overflow' errors pertaining to playing sounds.
I have now changed my sound manager to use MediaPlayer. This seems to be working out fine for now. I am just wondering if any other developers are experiencing these problems?