Ninjadoodle Posted July 10, 2014 Share Posted July 10, 2014 Hi guys I've look everywhere, but can't seem to figure out how to mute a sound/music or change their volume. If anyone has any ideas, that would be awesome Thank you in advance! Quote Link to comment Share on other sites More sharing options...
enpu Posted July 10, 2014 Share Posted July 10, 2014 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(); }} Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted July 13, 2014 Author Share Posted July 13, 2014 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! Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted July 15, 2014 Author Share Posted July 15, 2014 Hi guys I still haven't managed to solve this one. Has anyone been able to implement separate MUSIC / SFX buttons that mute the sounds instead of pausing? Thank you heaps in advance! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.