Skip to content

Commit

Permalink
v2.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
goldfire committed Jan 20, 2018
1 parent b876c06 commit 7a89f39
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 31 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 2.0.8 (January 19, 2018)
- `CHANGED` Fades now use elapsed time to be more accurate when intervals are inconsistent ([#885](https://github.com/goldfire/howler.js/issues/885)).
- `CHANGED` Improve timing of short fades ([#884](https://github.com/goldfire/howler.js/issues/884)).
- `FIXED` Fixed another Chrome deprecation when setting playback rate.
- `FIXED` Prevent `onplay` from firing when first setting `stereo` value ([#843](https://github.com/goldfire/howler.js/issues/843)).

## 2.0.7 (December 18, 2017)
- `FIXED` Accidental `const` was included in the previous version.

Expand Down
4 changes: 2 additions & 2 deletions dist/howler.core.min.js

Large diffs are not rendered by default.

36 changes: 15 additions & 21 deletions dist/howler.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*!
* howler.js v2.0.7
* howler.js v2.0.8
* howlerjs.com
*
* (c) 2013-2017, James Simpson of GoldFire Studios
* (c) 2013-2018, James Simpson of GoldFire Studios
* goldfirestudios.com
*
* MIT License
Expand Down Expand Up @@ -1166,26 +1166,20 @@
_startFadeInterval: function(sound, from, to, len, id, isGroup) {
var self = this;
var vol = from;
var dir = from > to ? 'out' : 'in';
var diff = Math.abs(from - to);
var steps = diff / 0.01;
var stepLen = (steps > 0) ? len / steps : len;

// Since browsers clamp timeouts to 4ms, we need to clamp our steps to that too.
if (stepLen < 4) {
steps = Math.ceil(steps / (4 / stepLen));
stepLen = 4;
}
var diff = to - from;
var steps = Math.abs(diff / 0.01);
var stepLen = Math.max(4, (steps > 0) ? len / steps : len);
var lastTick = Date.now();

// Store the value being faded to.
sound._fadeTo = to;

// Update the volume value on each interval tick.
sound._interval = setInterval(function() {
// Update the volume amount, but only if the volume should change.
if (steps > 0) {
vol += (dir === 'in' ? 0.01 : -0.01);
}
// Update the volume based on the time since the last tick.
var tick = (Date.now() - lastTick) / len;
lastTick = Date.now();
vol += diff * tick;

// Make sure the volume is in the right bounds.
vol = Math.max(0, vol);
Expand Down Expand Up @@ -1359,7 +1353,7 @@

// Change the playback rate.
if (self._webAudio && sound._node && sound._node.bufferSource) {
sound._node.bufferSource.playbackRate.value = rate;
sound._node.bufferSource.playbackRate.setValueAtTime(rate, Howler.ctx.currentTime);;
} else if (sound._node) {
sound._node.playbackRate = rate;
}
Expand Down Expand Up @@ -1922,7 +1916,7 @@
sound._node.bufferSource.loopStart = sound._start || 0;
sound._node.bufferSource.loopEnd = sound._stop;
}
sound._node.bufferSource.playbackRate.value = sound._rate;
sound._node.bufferSource.playbackRate.setValueAtTime(sound._rate, Howler.ctx.currentTime);

return self;
},
Expand Down Expand Up @@ -2279,10 +2273,10 @@
/*!
* Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported.
*
* howler.js v2.0.7
* howler.js v2.0.8
* howlerjs.com
*
* (c) 2013-2017, James Simpson of GoldFire Studios
* (c) 2013-2018, James Simpson of GoldFire Studios
* goldfirestudios.com
*
* MIT License
Expand Down Expand Up @@ -2867,7 +2861,7 @@

// Update the connections.
if (!sound._paused) {
sound._parent.pause(sound._id, true).play(sound._id);
sound._parent.pause(sound._id, true).play(sound._id, true);
}
};
})();
6 changes: 3 additions & 3 deletions dist/howler.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/howler.spatial.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "howler",
"version": "2.0.7",
"version": "2.0.8",
"description": "Javascript audio library for the modern web.",
"homepage": "https://howlerjs.com",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion src/howler.core.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* howler.js v2.0.7
* howler.js v2.0.8
* howlerjs.com
*
* (c) 2013-2018, James Simpson of GoldFire Studios
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/howler.spatial.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported.
*
* howler.js v2.0.7
* howler.js v2.0.8
* howlerjs.com
*
* (c) 2013-2018, James Simpson of GoldFire Studios
Expand Down

0 comments on commit 7a89f39

Please sign in to comment.