Skip to content

Commit f1430ed

Browse files
authored
Fix for the issue with volume reset after _unlockAudio()
If the main volume was set before _unlockAudio() is called - it had been resetting to 1.
1 parent 808fe34 commit f1430ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/howler.core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2459,7 +2459,7 @@
24592459
// Create and expose the master GainNode when using Web Audio (useful for plugins or advanced usage).
24602460
if (Howler.usingWebAudio) {
24612461
Howler.masterGain = (typeof Howler.ctx.createGain === 'undefined') ? Howler.ctx.createGainNode() : Howler.ctx.createGain();
2462-
Howler.masterGain.gain.setValueAtTime(Howler._muted ? 0 : 1, Howler.ctx.currentTime);
2462+
Howler.masterGain.gain.setValueAtTime(Howler._muted ? 0 : Howler._volume, Howler.ctx.currentTime);
24632463
Howler.masterGain.connect(Howler.ctx.destination);
24642464
}
24652465

0 commit comments

Comments
 (0)