Skip to content

Commit

Permalink
Fix for the issue with volume reset after _unlockAudio()
Browse files Browse the repository at this point in the history
If the main volume was set before _unlockAudio() is called - it had been resetting to 1.
  • Loading branch information
ilyabesk authored Aug 19, 2019
1 parent 808fe34 commit f1430ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/howler.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2459,7 +2459,7 @@
// Create and expose the master GainNode when using Web Audio (useful for plugins or advanced usage).
if (Howler.usingWebAudio) {
Howler.masterGain = (typeof Howler.ctx.createGain === 'undefined') ? Howler.ctx.createGainNode() : Howler.ctx.createGain();
Howler.masterGain.gain.setValueAtTime(Howler._muted ? 0 : 1, Howler.ctx.currentTime);
Howler.masterGain.gain.setValueAtTime(Howler._muted ? 0 : Howler._volume, Howler.ctx.currentTime);
Howler.masterGain.connect(Howler.ctx.destination);
}

Expand Down

0 comments on commit f1430ed

Please sign in to comment.