Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Runtime Development

Posts: 28
Registered: ‎06-12-2012
My Device: 9900, PlayBook

Delay before playing sounds with SoundPool



I have an app that runs well on many Android devices and also on the PlayBook, but I've just been testing it on my new Z10 and quite often there's a noticeable pause occurring before certain sounds play (i.e. the whole app freezes for a split second!).  However this won't always happen - sometimes I'll run the app and there will be no pauses at all, whereas other times it's very noticeable.  When it's happening I find that the pauses won't happen when the same sound is played in quick succession, but if it's then played a few seconds later the pause will happen.


All my sounds are mono WAVs with a bit rate of 705kbps (44100Hz), so could it be that this is too high a rate for the Z10 or BB10 in general?  If so, please advise on a more acceptable rate.


Also the main culprit sounds are often very short sounds, sometimes less than a second in duration.


Any ideas?






New Contributor
Posts: 8
Registered: ‎05-09-2012
My Device: Playbook

Re: Delay before playing sounds with SoundPool

A quick test right now of one of our Android apps on the Playbook didn't show any problems, but I don't have one of our more complex audio apps yet ported. This app uses about 6 short sounds.  Repetive hits of the same sound work fine.


This may be an Android v2.3 problem.I don't know where Blackberry's audio implmentation differes (at the lower levels) than a Android device, but there are well known bugs with Soundpool and Android 2.3 and dual-core processors (maybe quad core too).  We've seen similar problems with strictly Android devices - often the second same sound is delayed, but then later same sounds are not.  Worse, when you use many sounds (> 8 or so?) soundpool will intermittently crash.  These bugs appear to have been fixed in v3+ and never happened in 2.2 or older, but we're unaware of any version of 2.3 that has a fix.



Posts: 28
Registered: ‎06-12-2012
My Device: 9900, PlayBook

Re: Delay before playing sounds with SoundPool

Thanks for the reply!


Yup, SoundPool is fine on my PlayBook also - it's the Z10 that has the problem.

There are other Z10 issues too, such as updating the volume on an already-playing MediaPlayer not working (and again this isn't a problem on PlayBook).


I'm also aware of the Android SoundPool crash you mention on dual-core devices, although I've not seen this happen on any BlackBerry devices so far.


I'm hoping someone from BlackBerry is going to divulge some of the details of the BB10 audio implementation and tell us why it seems to differ from the lovely PlayBook version.  :-)