mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-12-03 03:12:51 +08:00
fix(audio): preserve in-progress pause fade on stop
This commit is contained in:
1 parent
7ee8b6f986
commit
6f165b5e88
1 file changed
+8
-4
+8
-4
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user