Jump to content

Muting Sounds / Sound Volume?


Ninjadoodle
 Share

Recommended Posts

Try something like this:

mute: function() {    if (!game.audio.musicMuted) {        game.audio.pauseAll();        game.audio.soundMuted = game.audio.musicMuted = true;    }    else {        game.audio.soundMuted = game.audio.musicMuted = false;        game.audio.resumeAll();    }}
Link to comment
Share on other sites

Hi enpu

 

Thank you for the reply :) I've tried your solution and it works well for pausing music, but the problem is when I want to also have a SFX button.

 

The function seems to pause all sounds. Is there a way to could mute music and sfx separately?

 

Also, is it possible to mute instead of pause. Pausing is not really an issue with music, but it is with sound effects.

 

If I pause a sound effect in one level, then unpause in the next, it will continue playing where it left off.

 

Thank you again for the help!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...