Sign in to follow this  
jorge.graca

Mute/Volume=0 Not working

Recommended Posts

Hi all,

 

I am using sound sprites to make tiny button sounds, however when I place the mute=true on the sound manager the button still plays the first time (not the following) after the system was muted. Is this a know bug?

preload: function() {    this.load.audio('button_press', 'button_press.wav');},create: function() {    this.clickSound = new Phaser.Sound(this.game, 'button_press');    this.clickSound.play();//plays sound    this.game.sound.mute = true;    this.clickSound.play();//also plays sound (only the first few moments)}						

Thanks.

phaser mute issue.zip

Share this post


Link to post
Share on other sites

I am not a Phaser guy... but it doesn't seem obvious to me that this should be a bug. I mean it seems reasonable to me that sound could take a few milliseconds to go silent after muting is enabled (eg. to allow event handling*, perhaps to fade the volume out to prevent a hard clip**)

 

Why not do something like:

if (this.game.sound.mute !true)

  this.clickSound.play();

 

 

 

*nb: I suspect this might be the actual reason

**  Not saying Phaser necessarily does this, but in a perfect world it might and thus I feel it is still a valid counterexample

Share this post


Link to post
Share on other sites

As is illustrated in the example attached the issue is not the fadeout, the issue is that the next sound that is played with mute on always plays.

That is clearly an issue, why would there be a fadeout on a new sound after the mute has been switched?

 

I could do the "if" you mention, in all sounds I play in the entire game... I rather that "if" to be inside the play function at least. Hence, the Phaser issue.

Share this post


Link to post
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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.