Calling super method in setRate method of WebAudioSound class, setting returned value to source playback rate audio param and returning the same value to match method signature

This commit is contained in:
Pavle Goloskokovic 2017-11-27 17:32:16 +01:00
parent f389176362
commit cf46145d7c

View file

@ -156,13 +156,11 @@ var WebAudioSound = new Class({
* @private
*/
setRate: function () {
var totalRate = BaseSound.prototype.setRate.call(this);
if (this.source) {
var cent = 1.0005777895065548; // Math.pow(2, 1/1200);
var totalDetune = Math.max(-1200, Math.min(this.currentConfig.detune + this.manager.detune, 1200));
var detuneRate = Math.pow(cent, totalDetune);
var totalRate = this.currentConfig.rate * this.manager.rate * detuneRate;
this.source.playbackRate.setValueAtTime(totalRate, 0);
}
return totalRate;
}
});
/**