Skip to content

Commit

Permalink
Replace deprecated gain.value with gain.setValueAtTime
Browse files Browse the repository at this point in the history
Fixes #856
  • Loading branch information
goldfire committed Dec 1, 2017
1 parent 075189c commit 0b538a7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/howler.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@

// When using Web Audio, we just need to adjust the master gain.
if (self.usingWebAudio) {
self.masterGain.gain.value = vol;
self.masterGain.gain.setValueAtTime(vol, Howler.ctx.currentTime);
}

// Loop through and change volume for all HTML5 audio nodes.
Expand Down Expand Up @@ -123,7 +123,7 @@

// With Web Audio, we just need to mute the master gain.
if (self.usingWebAudio) {
self.masterGain.gain.value = muted ? 0 : self._volume;
self.masterGain.gain.setValueAtTime(muted ? 0 : self._volume, tHowler.ctx.currentTime);

This comment has been minimized.

Copy link
@goldenratio

goldenratio Dec 6, 2017

tHowler ? is this a typo?

This comment has been minimized.

Copy link
@goldfire

goldfire Dec 6, 2017

Author Owner

@goldenratio Thanks for catching that, just committed a fix.

}

// Loop through and mute all HTML5 Audio nodes.
Expand Down Expand Up @@ -2212,7 +2212,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.value = Howler._muted ? 0 : 1;
Howler.masterGain.gain.setValueAtTime(Howler._muted ? 0 : 1, Howler.ctx.currentTime);
Howler.masterGain.connect(Howler.ctx.destination);
}

Expand Down

0 comments on commit 0b538a7

Please sign in to comment.