mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-02 04:52:50 +08:00
fix(spotify): correct Spotify seek units (s→ms) + gate re-attach on player external state
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
b5b3585e77
commit
9c796ec05c
4 files changed
+79
-19
No files matched your search
@@ -377,6 +377,21 @@ describe("AudioPlayer external-PCM mode (playPcmStream)", () => {
|
||||
player.stop();
|
||||
});
|
||||
|
||||
it("isExternalActive() is false initially, true after playPcmStream, false after stop()", () => {
|
||||
const player = new AudioPlayer(silentLogger);
|
||||
// Idle: never attached.
|
||||
expect(player.isExternalActive()).toBe(false);
|
||||
|
||||
const stream = openPcmReadable();
|
||||
player.playPcmStream(stream, {});
|
||||
// Attached to the external sidecar stream.
|
||||
expect(player.isExternalActive()).toBe(true);
|
||||
|
||||
player.stop();
|
||||
// Detached again — the orchestrator uses this to know it must re-attach.
|
||||
expect(player.isExternalActive()).toBe(false);
|
||||
});
|
||||
|
||||
it("pause()/resume() still gate local emission in external mode (unchanged semantics)", async () => {
|
||||
const player = new AudioPlayer(silentLogger);
|
||||
const stream = openPcmReadable();
|
||||
|
||||
Reference in new issue
Block a user