looping sounds

Get help using Construct 2

Post » Thu Nov 07, 2013 10:20 pm

how to stop a looping sound?

i do this : play "hydro" (looped)
             wait 3 s
             stop"hydro"
it doesen't work, why?
B
6
Posts: 28
Reputation: 831

Post » Thu Nov 07, 2013 10:21 pm

the sound is continuing....
B
6
Posts: 28
Reputation: 831

Post » Thu Nov 07, 2013 10:42 pm

If you link the code it would be easier. From what you have written it doesn't seem that anything should be wrong.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,838

Post » Thu Nov 07, 2013 10:54 pm

How long is that sound? Is it longer than the time you set in your loop?
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,583

Post » Thu Nov 07, 2013 11:12 pm

Is it done during a trigger or continuous event? If it is called with something like 'trigger once while true' that code should work. If, not, that may be your problem.C-72013-11-07 23:13:46
B
103
S
38
G
19
Posts: 962
Reputation: 17,996

Post » Fri Nov 08, 2013 2:54 am

yes my sound is longer than the loop loop=3 second and during 15 seconds
it's an hydrolic door open ...i think maybe just music can be looped not sounds?
i don't understand your trigger once while true;
so what is the code?
B
6
Posts: 28
Reputation: 831

Post » Fri Nov 08, 2013 2:56 am

triger, continous event what is that? i'm a novice sorry
B
6
Posts: 28
Reputation: 831

Post » Fri Nov 08, 2013 3:10 am

Most events run each tick (every time the cpu runs through the event sheet). There are some events that inherently only run a single time (on mouse clicked, on collision, etc). The rest of them happen repeatedly. I suspect the sound is getting played repeatedly and the stopping is only stopping a single instance of it. If you have an event that you want to force to play once (something like "If variable > 4, play sound"), you can go to System>Trigger Once While True to make that event only run a single time instead of repeatedly.
B
103
S
38
G
19
Posts: 962
Reputation: 17,996

Post » Fri Nov 08, 2013 9:25 pm

ok i find what's wrong i forget to put a tag on the sound it's working, fantastic
B
6
Posts: 28
Reputation: 831


Return to How do I....?

Who is online

Users browsing this forum: StillSarah and 21 guests