Can't Mute Sound Properly

0 favourites
  • 5 posts
From the Asset Store
Best soundtracks for any game. High quality and engaging assets.
  • Link to .capx file (required!):

    dl.dropboxusercontent.com/u/50465867/Errors/Mute.capx

    Steps to reproduce:

    1. Click Mute button to toggle mute on and off for tagged sfx

    2. Click the circle to play a sound

    Observed result:

    Chrome - The sound can still be heard, as though it plays before the system knows it's muted. It is sharply cut off, resulting in a minor tapping sound. I thought it was tagged sounds it had a problem with, but it's happening if it's untagged too.

    Internet Explorer - Works best out of the 3 main browsers, but if you tap very fast, you can still hear a tapping on occasion.

    Firefox - Worst. Doesn't seem to know when to mute and when not to. Results vary.

    Expected result:

    Mute should be silenced, and not play anything at all.

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer: yes

    Operating system & service pack:

    Windows 7 SP1

    Construct 2 version:

    r148

  • Closing as not a bug. You play the sound at 0dB volume, then mute it the next tick. So you are hearing about 16ms of audio playback, which is what your events specify.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ashley, sorry, I don't understand. What order should I have my events set up in then? I can't get it to work.

    Surely if sound is muted, it shouldn't play at all. In my game I have a global variable.

    0 = Unmuted

    1 = Mute

    This variable is then called to mute or unmute which is done at the start of the layout.

    The sound is then called on an action, and I still hear a split second. Works fine with music.

    Do you mind tweaking my capx to actually have mute working?

  • Make the conditions that check for muted state sub-events to the click event. Then at least you set the mute state immediately, rather than playing the audio at full volume, then waiting for the next run of the events a few milliseconds later to set the muted state. (Remember triggers fire outside of the normal top-to-bottom event flow.)

    Even then some implementations may play a short click, since you still play the audio at full volume, then mute it a moment later, and audio may start playing between the two actions running. If you intend to have the audio muted, don't play it at 0dB - play it at -99dB to begin with.

  • Ashley

    As a work around I had already gone through my project and added in an event that only plays the sound when the variable = 0. It was a bit of a pain doing this to each and every sound, but then again it'll be a lot easier the next time.

    Seems unusual that the mute event doesn't really work as I expect it to. I thought it would control a global override aspect of the code automatically, to say if muted, don't play the sounds in the first place.

    As it stands, it looks like I'll have more luck putting all sounds in a group which is deactivated when my mute variable is on, rather than using the mute function at all.

    Thanks for the pointers :)

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