diff --git a/src/voice-broadcast/models/VoiceBroadcastPlayback.ts b/src/voice-broadcast/models/VoiceBroadcastPlayback.ts index 9ec50e094d..412deac3a4 100644 --- a/src/voice-broadcast/models/VoiceBroadcastPlayback.ts +++ b/src/voice-broadcast/models/VoiceBroadcastPlayback.ts @@ -388,6 +388,7 @@ export class VoiceBroadcastPlayback public stop(): void { this.setState(VoiceBroadcastPlaybackState.Stopped); + this.getCurrentPlayback()?.stop(); this.currentlyPlaying = null; this.setPosition(0); } @@ -397,7 +398,6 @@ export class VoiceBroadcastPlayback if (this.getState() === VoiceBroadcastPlaybackState.Stopped) return; this.setState(VoiceBroadcastPlaybackState.Paused); - if (!this.currentlyPlaying) return; this.getCurrentPlayback()?.pause(); } diff --git a/test/voice-broadcast/models/VoiceBroadcastPlayback-test.ts b/test/voice-broadcast/models/VoiceBroadcastPlayback-test.ts index 759adf1128..616875816b 100644 --- a/test/voice-broadcast/models/VoiceBroadcastPlayback-test.ts +++ b/test/voice-broadcast/models/VoiceBroadcastPlayback-test.ts @@ -411,6 +411,10 @@ describe("VoiceBroadcastPlayback", () => { stopPlayback(); itShouldSetTheStateTo(VoiceBroadcastPlaybackState.Stopped); + it("should stop the playback", () => { + expect(chunk1Playback.stop).toHaveBeenCalled(); + }); + describe("and skipping to somewhere in the middle of the first chunk", () => { beforeEach(async () => { mocked(chunk1Playback.play).mockClear();