Skip to content

Commit

Permalink
Fix volume not setting correctly (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
buzzbyte authored and mon committed Jan 16, 2021
1 parent 233d788 commit a675f70
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/js/SoundManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand Down

0 comments on commit a675f70

Please sign in to comment.