I have a sound based application on the market and use SoundPool.

Long story short, it is quirky to say the least and only likes small
sound files. I have been able to play sounds over and over (as in a
loop) and change sounds though without issue once I matched up loading
and unloading correctly.

I don't have the code on me right now but can get it to you later. For
now though, keep the files small, and unloading matched, and it should
work.

On Jan 24, 7:45 pm, Steve <rockthesm...@gmail.com> wrote:
> Hi there,
>
> I am using a SoundPool to control the SFX in my game, which is
> targeted at Android 1.6 devices. Initially, I am able to do everything
> I wish to do, but after sometime of playing the game (can be a few
> minutes, can be more than thirty minutes), I am no longer able to play
> sounds, and instead am seeing messages in my log such as:
>
> SoundPool - sample 440 not READY
>
> The thing is, these samples never become ready - in fact from this
> moment on, no sound effects ever appear to be ready - it is almost as
> if the thread that handles the loading gets stuck and then no more
> sounds can load.
>
> Any sounds that are loaded for the duration of the game can still be
> played and function correctly, but sounds that get loaded per level
> will no longer work from this point on.
>
> I have a session of my game running now that is exhibiting this
> problem, and some statistics I have are:
>
>  - I have made 516 calls to load
>  - I have made 513 calls to unload (I have three sounds that are
> resident, all the other loads/unloads are as I have gone in and out of
> many levels)
>  - I have made 1547 play calls
>  - I have made 1547 stop calls
>
> I have spent some time debugging this now, and have ensured all load
> and unloads match up, and the same for play/stop calls, but I am not
> really sure what I can do next now. My only fallback I could code up
> is to destroy the sound pool from time to time, and reload the
> resident sounds - it isn't a clean solution, but I am at a loss as to
> what else I can do. It feels like the problem is more likely to crop
> up when loading/unloading lots of SFX in succession, I am not sure if
> it could be a race case to do with a resource not quite being in a
> loaded state, and not quite being in an unloaded state - of course
> this whole situation is made a lot worse by the fact I don't have a
> sensible method of querying when a sound is actually loaded in Android
> 1.6.
>
> Someone out there must have a largish game on Android 1.6, using the
> SoundPool successfully? Can anyone help?
>
> Many thanks,
>
> Steve

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to