How to properly set a mute button?

Get help using Construct 2

Post » Fri Jun 22, 2012 7:35 pm

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)
B
3
Posts: 1
Reputation: 277

Post » Wed Oct 24, 2012 12:27 pm

Did you ever get this solved?
B
19
S
3
G
2
Posts: 212
Reputation: 4,011

Post » Wed Oct 24, 2012 6:14 pm

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.

B
14
S
5
G
4
Posts: 121
Reputation: 3,938


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 18 guests