AudioCache Error - Soundpool suddenly unable to load sample from URL on Android

494 views Asked by At

My SoundPool is in a Service and I use it to cache sounds from different urls, and play them later. The app was working fine, without any error, but today it crashed.

The source code is the same, nothing changed. I tried to reinstall the app, restart the device, nothing worked... After 30 minutes of trying to do something, the app started to work again on tablet, but not on my phone.

This is the code for loading the sounds:

soundPool = new SoundPool(14, AudioManager.STREAM_MUSIC,100);
soundPoolMap = new HashMap<Integer, Integer>();
soundPoolMap.put(key, soundPool.load(task[2], 1));

A soundID is returned by the load() method and it is not 0, but after that (? why after ?), I get the following error message:

11-26 15:28:09.743: E/GenericSource(187): Failed to create http source!
11-26 15:28:09.743: E/AudioCache(187): Error 1, -2147483648 occurred
11-26 15:28:09.743: D/NuPlayerDriver(187): reset(0xb8334b60)
11-26 15:28:09.744: D/NuPlayerDriver(187): notifyResetComplete(0xb8334b60)
11-26 15:06:54.597: E/SoundPool(3914): Unable to load sample: http://myurl/bet.mp3

The URL is fine, i tested it in a browser.

What could cause this strange bahavior?

0

There are 0 answers