-
About sounds
I've create an application with sounds but I don't know how to stop the sounds.My application is something like this:
Start of Frame
-Deactivate Group 2
Group 1
-Run this event once - Play sample "music1.ogg" 0 times
Group 2
-Run this event once - Play sample "music2.ogg" 0 times
Upon pressing Up Arrow - Deactivate Group 1 - Activate Group 2
Upon pressing Down Arrow - Deactivate Group 2 - Activate Group 1
I think the error is with this line "Run this event once" but don't know what to put...
What can I do ? Thanks !
-
Re: About sounds
Closing a group does not stop the sounds inside the groups. To stop a looping sound, you must use "stop sample" or "stop channel".
-
Re: About sounds
you'd also want to replace the "run this even once" with a "run this even once when action loops", plus what nifflas said.
-
Re: About sounds
At Limit conditions appear only "Run this even once" and "Only one action when event loops". Where is "run this even once when action loops" ?
-
Re: About sounds
He meant the one that say: "Only one action when event loops"
-
Re: About sounds
Still, I can't see any reason why to put those "play sample" actions in groups, what are you trying to accomplish with that? Closing a group does not revert the actions within it, you can't stop a playing sound by closing a group.
Why not just:
Upon pressing Up Arrow: Play sample "music1.ogg" on channel 1, 0 times
Upon pressing Down Arrow: Play sample "music2.ogg" on channel 1, 0 times
That way, the first song will interupt when you start the next, since you're playing it on the same channel.
-
Re: About sounds
I use deactivate/active Groups because I have put some sounds in there. Anyway it's working :D Thank you very much !