Fixed issue with changing rate on a sound with delayed playback

This commit is contained in:
Pavle Goloskokovic 2017-12-14 14:04:05 +01:00
parent 0c84f78e9e
commit 06362216d1

View file

@ -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