mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 14:38:30 +00:00
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:
parent
f389176362
commit
cf46145d7c
1 changed files with 2 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
});
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue