mirror of
https://github.com/Tonejs/Tone.js
synced 2024-12-28 12:33:12 +00:00
Merge pull request #963 from Tonejs/revert-942-buffer-player-timekeeping
Revert "fix for AudioBufferSourceNode stop time miscalculation"
This commit is contained in:
commit
5c15c9517d
1 changed files with 2 additions and 3 deletions
|
@ -168,8 +168,7 @@ export abstract class OneShotSource<
|
|||
|
||||
// schedule the stop callback
|
||||
this._stopTime = this.toSeconds(time) + fadeOutTime;
|
||||
const nowTime = this.now();
|
||||
this._stopTime = Math.max(this._stopTime, nowTime);
|
||||
this._stopTime = Math.max(this._stopTime, this.context.currentTime);
|
||||
if (fadeOutTime > 0) {
|
||||
// start the fade out curve at the given time
|
||||
if (this._curve === "linear") {
|
||||
|
@ -189,7 +188,7 @@ export abstract class OneShotSource<
|
|||
this._curve === "exponential" ? fadeOutTime * 2 : 0;
|
||||
this._stopSource(this.now() + additionalTail);
|
||||
this._onended();
|
||||
}, this._stopTime - nowTime);
|
||||
}, this._stopTime - this.context.currentTime);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue