[Solved by bug workaround] Audio refuses to stop playing

Get help using Construct 3!

Post » Mon Jun 19, 2017 9:36 am

Image
Neither events stop the music, but the music still starts playing, so the events are functional, the stop mechanic is not.
I've tried pausing the audio as well, which doesn't work, and setting the volume, which doesn't work.

Anyone got advice?
Last edited by Sumyjkl on Tue Jun 20, 2017 3:40 am, edited 1 time in total.
B
42
S
14
G
3
Posts: 165
Reputation: 5,115

Post » Mon Jun 19, 2017 9:48 am

Looking at your code, pressing P should stop both samples from playing.

Do you have any music playing before this layout starts? If so that will continue looping and won't stop unless it has the same tags referenced in the code.
B
20
S
8
G
3
Posts: 460
Reputation: 4,059

Post » Mon Jun 19, 2017 10:49 am

mekonbekon wrote:Looking at your code, pressing P should stop both samples from playing.

Do you have any music playing before this layout starts? If so that will continue looping and won't stop unless it has the same tags referenced in the code.


Unfortunately not. I wish it was something that simple, but those are the only events that play music. There are sounds elsewhere, but not anything playing with those tags.
B
42
S
14
G
3
Posts: 165
Reputation: 5,115

Post » Tue Jun 20, 2017 3:39 am

Solved.

Found out there's a bug involved; audio playing from a previous layout will keep playing even when you try to stop it. Turns out I have to stop the music before switching layouts.
B
42
S
14
G
3
Posts: 165
Reputation: 5,115

Post » Thu Jun 22, 2017 5:31 am

could it be because its a subevent linked to on start of layout? it could be checking to see if P is being pressed on the start, as opposed to after the layer has started. something worth checking into, but yeah, whenever i switch a layout ill generally stop all music and restart it. you can create a seamless loop with an extra line or 2 of code, where as, every 1 second add 1 to MusicTimer, and on start of layout, play menuMusic from start point MusicTimer. if MusicTimer = MusicLength, Set MusicTimer to 0 (so when it loops it restarts the timer)
B
22
S
12
G
1
Posts: 108
Reputation: 2,774


Return to How do I...?

Who is online

Users browsing this forum: Kyatric and 0 guests