Skip to content

Commit 7adb101

Browse files
Updating rate updates correctly if delay has not yet elapsed
1 parent 8ea3dbd commit 7adb101

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

v3/src/sound/webaudio/WebAudioSound.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,15 @@ var WebAudioSound = new Class({
205205
this.source.playbackRate.setValueAtTime(this.totalRate, 0);
206206
}
207207
if (this.isPlaying) {
208-
this.rateUpdates.push({
209-
time: this.manager.context.currentTime - this.playTime,
210-
rate: this.totalRate
211-
});
208+
if (this.manager.context.currentTime < this.startTime) {
209+
this.rateUpdates[this.rateUpdates.length - 1].rate = this.totalRate;
210+
}
211+
else {
212+
this.rateUpdates.push({
213+
time: this.manager.context.currentTime - this.playTime,
214+
rate: this.totalRate
215+
});
216+
}
212217
}
213218
},
214219
/**

0 commit comments

Comments
 (0)