mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 21:24:09 +00:00
Using the same current time value for updating source playback rate and adding rate update item to the array
This commit is contained in:
parent
13d891893c
commit
cd6b6bf574
1 changed files with 3 additions and 2 deletions
|
@ -250,12 +250,13 @@ var WebAudioSound = new Class({
|
|||
*/
|
||||
setRate: function () {
|
||||
BaseSound.prototype.setRate.call(this);
|
||||
var now = this.manager.context.currentTime;
|
||||
if (this.source) {
|
||||
this.source.playbackRate.setValueAtTime(this.totalRate, 0);
|
||||
this.source.playbackRate.setValueAtTime(this.totalRate, now);
|
||||
}
|
||||
if (this.isPlaying) {
|
||||
this.rateUpdates.push({
|
||||
time: Math.max(this.startTime, this.manager.context.currentTime) - this.playTime,
|
||||
time: Math.max(this.startTime, now) - this.playTime,
|
||||
rate: this.totalRate
|
||||
});
|
||||
if (this.loopSource) {
|
||||
|
|
Loading…
Reference in a new issue