From: Jer Noble Date: Thu, 27 Mar 2014 17:57:27 +0000 (-0700) Subject: Fix .muted when playing. X-Git-Url: http://id.pley.net/sound.git/commitdiff_plain/45ddec7e27af3ded3ebb81d2d2200e6331deb8f1?ds=inline;hp=45b342640b26802ce9102a9e794a091f956c54a2 Fix .muted when playing. --- diff --git a/sound.js b/sound.js index efddc12..c4f9c0e 100644 --- a/sound.js +++ b/sound.js @@ -146,7 +146,7 @@ Sound.prototype = { playInternal: function() { this.gainNode = Sound.audioContext.createGainNode(); - this.gainNode.gain.value = this._volume; + this.gainNode.gain.value = this._muted ? 0 : this._volume; this.gainNode.connect(Sound.audioContext.destination); this.node = Sound.audioContext.createBufferSource();