02-06-2012 01:47 AM
02-07-2012 09:13 AM
Try encoding your sound effects in ogg format. SoundPool has problems with some mp3s (not only on PlayBook, but on some Google TV and other Android devices as well). In my experience, ogg is a safer option.
02-07-2012 09:21 AM
Thanks, I will try that and repost. But the official API support page states that ogg is not supported on the Playbook. So far I've tried wav, mp3, and aac. no luck with anyof them on the PlayBook. All of the formats I've tried work fine on my android devices..... I've tried repackaging the app through the ADT Plugin and through the online tools, with the same result. So far this has been very frustrating to port my app over. Also, the apk2barVerifier tool give me zero warning or errors.
02-07-2012 09:32 AM
I don't really know why the API Support page lists ogg as not supported. Maybe this information is obsolete? In any case, I have a PlayBook 188.8.131.5211 in front of me with my Android game on it. Ogg sound effects play just fine through SoundPool.
02-07-2012 10:58 AM
Anything I should know about bitrates or sample rates when I encode my sfx into ogg? What are you using that you've hard sucess with? all you're sound effects are in you "raw" folder right?
I don't have a Playbook (That's why I'm trying to port this app) so I'm just using the simulator... Maybe it's a problem with the simulator?
This is what I've been getting in logcat when running my app on the simulator. The red error messages occur once for every time I call the SoundPool.load() method. and the yellow warning message occurs when I try to call the SoundPool.play() method. The app works fine (with simulator lag) otherwise. But without sound effects, my app is essentially pointless. (its a kids picture book with sounds)
02-07-2012 02:27 PM - edited 02-07-2012 03:04 PM
I have two Android apps that I put on the device. One loads sounds into a SoundPool in onCreate from res/raw. The sound files are all 128 kbps mp3s, all mono, 11025Hz, 22050Hz, 44100Hz and 48000Hz. All of them play.
The other app originally had its sound effects as mp3 as well. The files are loaded from assets folder, and they are all 128kbps, stereo and mono mixed, again a variety of sample rates. The app displayed the same error messages in logcat as you see in yours ("Unable to load" and "sample not ready"). I cannot tell what difference between sound files of app 1 and app 2 makes one app work and the other app fail. Originally I thought it was stereo vs mono, but app 2 fails to load mono mp3s as well as stereo ones. I exported my mp3s as ogg for app 2, and all of them loaded an played.
I also put the same 2 apps on Logitech Revue with the following result:
app1: no sound at all
app2: no sound with mp3s, works fine with oggs
Both apps worked fine with mp3s in them on a variety of Android phones and tablets.
I am afraid I am not being very helpful here. For me it's all trial and error so far.
02-08-2012 10:29 AM
I too found my MP3 sounds didn't work via SoundPool, so I loaded them into Audacity and exported as Ogg (quality level 9) and they now work fine - so that's something to try if anyone has the same problem. One gotcha is to do a "Project / Clean..." in Eclipse before reupping to the simulator - I found the change wasn't picked up until I had done this.
02-08-2012 11:03 AM
I redid all of my sound effects in ogg and now it works fine.... Weird that one of the formats BlackBerry says specifically is NOT supported is the only format I've found that actually works...