From a675f704b7c84fa41b6a31ecc0f85c8adb3e9e3e Mon Sep 17 00:00:00 2001 From: Buzzbyte <1598588+buzzbyte@users.noreply.github.com> Date: Sat, 16 Jan 2021 02:06:57 -0500 Subject: [PATCH] Fix volume not setting correctly (#42) --- src/js/SoundManager.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/SoundManager.js b/src/js/SoundManager.js index 497d0eb..3752146 100644 --- a/src/js/SoundManager.js +++ b/src/js/SoundManager.js @@ -548,9 +548,9 @@ class SoundManager { this.lastVol = this.gainNode.gain.value; } if(mute) { - this.gainNode.gain.value = 0; + this.gainNode.gain.setValueAtTime(0, this.context.currentTime); } else { - this.gainNode.gain.value = this.lastVol; + this.gainNode.gain.setValueAtTime(this.lastVol, this.context.currentTime); } this.core.userInterface.updateVolume(this.gainNode.gain.value); this.mute = mute; @@ -574,7 +574,7 @@ class SoundManager { } setVolume(vol) { - this.gainNode.gain.value = vol; + this.gainNode.gain.setValueAtTime(vol, this.context.currentTime); this.lastVol = vol; this.core.userInterface.updateVolume(vol); }