fix(audio): preserve in-progress pause fade on stop

This commit is contained in:
EvolvedGhost committed 2026-10-17 23:42:07 +08:00
1 parent 7ee8b6f986
commit 6f165b5e88
1 file changed
+8 -4
+8 -4
View File
@@ -596,14 +596,18 @@ export class AudioPlayer extends EventEmitter {
}
stopWithFade(): void {
if (this.state !== "playing" || this.externalMode) {
if (this.externalMode || this.state === "idle") {
this.stop();
return;
}
this.stopAfterPauseTail = true;
this.pauseFrames = 9;
this.setTransportRamp(0, 0, 5);
this.state = "paused";
if (this.state === "playing") {
this.pauseFrames = 9;
this.setTransportRamp(0, 0, 5);
this.state = "paused";
} else if (this.pauseFrames === 0) {
this.stop();
}
}
stop(keepAlive = false): void {