Hello-
I have an app with multiple buttons in it. Each button plays an audio clip. But, when the buttons are pressed rapidly, all the audio starts playing at once and overlaps each other. This gets quite annoying, considering that up to 20-30 sounds could be playing at once. My question is how to make a button stop all other audio and then play its own sound.
My initial thought is to use stop.audio within the function. Is this correct, and - if so - how would I implement it within the button code? Here is my current code:
local onPhoneBtnLBTouch = function(event)
if event.phase=="ended" then
local myChannel = 6
local isChannelPlaying = audio.isChannelPlaying(myChannel)
if isChannelPlaying then
--nothing
else
audio.play( PhoneBtnLB\_audio, {channel=myChannel} )
end
Thank you greatly for your help!
[import]uid: 126736 topic_id: 24731 reply_id: 324731[/import]
[import]uid: 52491 topic_id: 24731 reply_id: 100269[/import]