On Android L - the latest developer preview (Nexus 5), there seems to be a regression in the SoundPool.load() method which takes >5 seconds to load a sample (<100kb), where samples were loaded on pre-L systems instantly with the very same code.
I tried OGG or MP3, both with same results. Tried different sizes but all under 100kb. Seems as 40kb or 80kb does not make any difference, so does OGG or MP3. Loading is always around 5s delay.
This seems as yet another regression in SoundPool after looping has been broken in 4.3.
The issue is easily reproducible with:
pool = new SoundPool(6, AudioManager.STREAM_MUSIC, 0);
// use a listener to start playback after load
pool.setOnLoadCompleteListener(listener);
// R.raw.sound1 is either an OGG or MP3 sample under 100kb od size
int id = pool.load(context, R.raw.sound1, 1);
// onLoadComplete() method of the listener is called several seconds after the call to laod()
The same is happening for constructing the SoundPool using the Builders introduced API 21 as follows:
AudioAttributes attr = new AudioAttributes.Builder()
.setUsage(AudioAttributes.USAGE_MEDIA)
.setContentType(AudioAttributes.CONTENT_TYPE_MUSIC)
.build();
pool = new SoundPool.Builder().setAudioAttributes(attr).setMaxStreams(6).build();
Is anyone else experiencing this? Did anyone find a workaround?
Many thanks!