jorge.graca Posted November 26, 2015 Share Posted November 26, 2015 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 Link to comment Share on other sites More sharing options...
imLeyenda Posted November 26, 2015 Share Posted November 26, 2015 Use volume = 0; Link to comment Share on other sites More sharing options...
jorge.graca Posted December 1, 2015 Author Share Posted December 1, 2015 Use volume = 0;That has exactly the same artifact, has is demonstrated in the attached example. Link to comment Share on other sites More sharing options...
chg Posted December 1, 2015 Share Posted December 1, 2015 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 Link to comment Share on other sites More sharing options...
jorge.graca Posted December 1, 2015 Author Share Posted December 1, 2015 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. Link to comment Share on other sites More sharing options...
Recommended Posts