[Solved by bug workaround] Audio refuses to stop playing

  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

  • 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.

  • 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)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)