How to properly set a mute button?

0 favourites
  • 3 posts
From the Asset Store
A whole set you need to create a gorgeous winter 2d game
  • Hello forum,

    I made a mute button in the game and it toggles "set silent" from true to false. But I don't know if this is a bug or not but when I tab out and then go back to the game it starts playing the background music even it is set as "set silent".

    What I am doing to do this:

    1: Layout start -> Run a inf looping background music.

    2: Button left click -> Toggle silent.

    3: When it is silent press another tab on your internet browser.

    4: Come back to the game and music plays again even though it is set as "silent"

    As far as I know the silent only seems to just mute all current playing and prevents future sounds from playing but whatever is currently playing it does not mute it and just plays it when you come back to the tab.

    Possible solution:

    Instead of using set silent just stop every sound? (which is a real pain)

  • Did you ever get this solved?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This is for Chrome (latest versions always), as it has the best HTML5 audio support right now.

    What you want to do is tell audio to mute playback, NOT set silent. Tag ALL of your audio files on playback (e.g. fx, music, ambient, etc.). For one time sounds (like a gunshot or car door), just tell it to stop when you press the button. For looping sounds (like ambient background sounds such as street noise), tell it to mute when you press the button.

    For music, make sure you actually have it in the music folder. Music in Chrome WILL follow the timescale (make sure you have music timescale on). Make audio playback rate "0" when you press the button, and then "1" when you press it again.

    <img src="http://wayofthesax.com/img/audio%20pause%20screenshot.png" border="0" />

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