(solved) How do I Pause all Music

0 favourites
  • 9 posts
From the Asset Store
6 looping tracks to use in your games and projects. These tracks are in the style of the 1960s detective movie genre.
  • I'm pretty sure I am on the wrong track with this method, my code works just fine but I have about 5 songs in this game, sure I could do what I'm doing here and pause all the songs, but the issue is the resume. My problem is my user interface is a an "include layout" so I don't have to copy all that code for each layout.

    Have I made one bit of sense in this post?

    Example:

  • You can use Audio > Set silent

  • That is true but that kills all my sounds, I only want to kill all the music, but keep the rest of my sounds active.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What if you tag all the music as "music" and set mute for that tag?

    C2 is definately lacking some channels on the audio object, something to link an sound to a channel and being able to mute just it.

    Haven't looked at how to write plugins yet, but maybe that's something to look after now

  • Now that is a interesting idea, bit then on resume music all the music would play.

  • Actually I don't think so. If your use MUTE, it will only unmuted the ones that were playing before, you are not calling PLAY. You can try with: mute, set volume to 0, pause. There are some different approaches to try out. I haven't messed that much with audio yet, so I can't tell you for sure which one would work.

  • If you plan to run your game on mobile, take note that there are many problems with audio support on mobile browsers and some of them do not respond to pause/resume,mute, volume and other audio commands.

    You may find this thread useful https://www.scirra.com/forum/viewtopic.php?f=147&t=93968

  • Thanks MaorKeshet I've not jumped on the mobile bandwagon yet but I need to and this is good information.

  • What if you tag all the music as "music" and set mute for that tag?

    C2 is definately lacking some channels on the audio object, something to link an sound to a channel and being able to mute just it.

    Haven't looked at how to write plugins yet, but maybe that's something to look after now

    I was wrong setting the tag to music works perfectly, at least for my needs, it's a great solution.

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