Skip to content

Commit 287dc70

Browse files
Simplified rate updates logic in setRate method
1 parent 0636221 commit 287dc70

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

v3/src/sound/webaudio/WebAudioSound.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,15 +205,8 @@ var WebAudioSound = new Class({
205205
this.source.playbackRate.setValueAtTime(this.totalRate, 0);
206206
}
207207
if (this.isPlaying) {
208-
var time = void 0;
209-
if (this.manager.context.currentTime < this.startTime) {
210-
time = this.startTime - this.playTime;
211-
}
212-
else {
213-
time = this.manager.context.currentTime - this.playTime;
214-
}
215208
this.rateUpdates.push({
216-
time: time,
209+
time: Math.max(this.startTime, this.manager.context.currentTime) - this.playTime,
217210
rate: this.totalRate
218211
});
219212
}

0 commit comments

Comments
 (0)