Looping sounds

Monkey Targets Forums/Android/Looping sounds

siread(Posted 2012) [#1]
Anyone had trouble looping sounds on Android? I can get one sound file to loop, but trying to loop another sound doesn't kick in. I've tried both ogg and mp3.

Also, if you stop the looping sound with StopChannel() and then call PlaySound() again it fails.


AdamRedwoods(Posted 2012) [#2]
sounds should be less than 1mb. otherwise use PlayMusic().


siread(Posted 2012) [#3]
After testing on a Samsung Galaxy and failing to get 2 sounds to loop, or even 1 sound to loop, stop and loop again I scrapped using PlaySound() with the loop flag. Instead I keep my own timer...

If Millisecs > crowdambience1 + 7836
	PlaySound(sndCrowdAmbience, CHN_CROWDAMBIENT1)
	crowdambience1 = Millisecs
End


7836 is the precise length of the sound file. Using this method you can loop as many sounds as you like.