Android SoundPool Heap Limitations

I use SoundPool to download multiple sound clips and play them.

It works 100% right, what can I say. But during .load () calls, I get my log, spam:

06-09 11:30:26.110: ERROR/AudioCache(23363): Heap size overflow! req size: 1050624, max size: 1048576 

I download 11 sound files, 2 of them are very small ~ 3kb, and the rest between 10kb - 15kb. Windows reports

Size: 114kb

Disk Size: 128kb

Am I pushing the limits of what SoundPool can hold? Is there some kind of setting that I have to change to avoid this overflow? Any advice on how I should set up my audio devices would be greatly appreciated.

+2
source share
1 answer

SoundPool is going to unpack the downloaded audio signal to PCM data so that it is ready to play instantly without decoding delay. If the audio you are downloading is highly compressed, such as MP3, then this could explode. Try to encode audio as mono if stereo is not required (usually this is not for short sound effects).

+3
source

All Articles