mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 14:38:30 +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,15 +205,17 @@ var WebAudioSound = new Class({
|
||||||
this.source.playbackRate.setValueAtTime(this.totalRate, 0);
|
this.source.playbackRate.setValueAtTime(this.totalRate, 0);
|
||||||
}
|
}
|
||||||
if (this.isPlaying) {
|
if (this.isPlaying) {
|
||||||
|
var time = void 0;
|
||||||
if (this.manager.context.currentTime < this.startTime) {
|
if (this.manager.context.currentTime < this.startTime) {
|
||||||
this.rateUpdates[this.rateUpdates.length - 1].rate = this.totalRate;
|
time = this.startTime - this.playTime;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.rateUpdates.push({
|
time = this.manager.context.currentTime - this.playTime;
|
||||||
time: this.manager.context.currentTime - this.playTime,
|
|
||||||
rate: this.totalRate
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
this.rateUpdates.push({
|
||||||
|
time: time,
|
||||||
|
rate: this.totalRate
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue