Page 1 of 1

mobilePlaySoundOnChannel - how to toggle looping of a sound ?

Posted: Tue Apr 30, 2024 9:29 am
by okk
Hi,
I run into an issue when I try to toggle the looping of a sound that was started with the mobilePlaySoundOnChannel command.

Code: Select all

mobilePlaySoundOnChannel sound, channel, type
What I would like to do is analogous to this command for desktop:

Code: Select all

set the looping of player myplayer to not the looping of player myplayer 
Any suggestions on how to achieve this? I try to avoid using the mobile player, I like the simplicity of the mobilePlaySoundOnChannel command.

When thinking about it, the current implementation of mobilePlaySoundOnChannel is a bit unlogical, with the options being "now", "next" or "looping". I think "looping" should be rather treated like a property such as Channel Volume. It would be nice to set it independently from the mobilePlaySoundonChannel command, but maybe it is possible, I just didn't see it yet...

Thanks for any pointers!
Oliver

Re: mobilePlaySoundOnChannel - how to toggle looping of a sound ?

Posted: Tue Apr 30, 2024 6:41 pm
by jacque
Any call to mobilePlaySoundOnChannel will stop the current sound if the sound channel is the same. You can stop the loop by calling mobilePlaySoundOnChannel with empty as the sound. Or you can replace it by calling mobilePlaySoundOnChannel with the same sound and passing "now" as the type.