I've been using SoundPool for awhile now with no issues to speak of,
but I recently added my first 'looped' sound, which led to the use of
pause/resume.

My problem is that while this works

streamId = play(...)  // loop = -1
...
pause( streamId )
..
resume( streamId )

--------------------------------------

This seems to fail

streamId = play()
...
pause( streamId )
..
playSomeOtherSoundWithACompletelyDifferentSoundIdAndStreamId
..
resume( streamId )

does nothing.

---

In the log I generally see some garbage collection occuring in the
second case which may not be happening in the first case.  It
SEEEEEEEEMs like playing the second sound, while the first is paused,
somehow damages the first sound's stream.  Trying to restart the first
sound with a 'play' also fails (in general, trying to 'play' a
'paused' sound appears to fail, requiring a 'resume' instead)

And 'stopping' the sound works to unjam it, but, of course, forces you
to reload the samples.

I've added enough logging that I am fairly sure I am not crossing my
streamIds, as it were.

Oh, and only the first sound is looped.  All other sounds are one-
shots

At first I thought it might have to do with the length of the looped
sound, but I have the same problem if I use a small sound for the
loop.  All sounds are 22KHz, mono, 16bit, from OGG resources.

---

And yes, I *did* chase my tail for awhlie thanks to some initial
confusion over sound Ids and stream Ids. (I think a few words in the
ref documents could be improved :-)

Actually, I wish there were a 'stop' that didn't release the samples,
as that's what I really want to do (not pause/resume)... some form of
pause/rewind/resume at the very least.

I've tried various forms of setLoop, thinking that perhaps it is just
losing that state along the way, but no joy.

Thanks in advance.



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

Reply via email to