mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 21:24:09 +00:00
Fixed issue with changing rate on a sound with delayed playback
This commit is contained in:
parent
0c84f78e9e
commit
06362216d1
1 changed files with 7 additions and 5 deletions
|
@ -205,16 +205,18 @@ var WebAudioSound = new Class({
|
|||
this.source.playbackRate.setValueAtTime(this.totalRate, 0);
|
||||
}
|
||||
if (this.isPlaying) {
|
||||
var time = void 0;
|
||||
if (this.manager.context.currentTime < this.startTime) {
|
||||
this.rateUpdates[this.rateUpdates.length - 1].rate = this.totalRate;
|
||||
time = this.startTime - this.playTime;
|
||||
}
|
||||
else {
|
||||
time = this.manager.context.currentTime - this.playTime;
|
||||
}
|
||||
this.rateUpdates.push({
|
||||
time: this.manager.context.currentTime - this.playTime,
|
||||
time: time,
|
||||
rate: this.totalRate
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* @private
|
||||
|
|
Loading…
Reference in a new issue