Apologies for necro-posting but I thought I might as well post the fix
I found for the non-looping sounds
in the code TJerkW posted.

Essentially setLoop() takes the Id of the instance of the sound that
is being played not the Id of the loaded sound.

So it should look something like this:
        public int playLoop(int resid) {
                int soundId=soundPoolMap.get(resid);
                int instanceId = soundPool.play(soundId, volume,
volume, 1, 0, 1f);
                soundPool.setLoop(instanceId, -1);

                return instanceId;
        }

I'm returning the Id so that I can stop it later when I want to.
--~--~---------~--~----~------------~-------~--~----~
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