refactor: modularize CRC mocking and implement a persistent Ogg stream for web audio playback

This commit is contained in:
baharsah
2026-05-13 01:12:11 +07:00
parent c911b06b95
commit 44ac346c21
6 changed files with 77 additions and 44 deletions

View File

@@ -32,9 +32,12 @@ export class DiscordPlayer {
}
public playStream(stream: Readable) {
console.log("[player] Starting new audio stream...");
// Use WebmDemuxer to extract Opus packets from browser stream
const demuxer = new prism.opus.WebmDemuxer();
demuxer.on('error', err => console.error("[player] Demuxer error:", err));
const resource = createAudioResource(stream.pipe(demuxer), {
inputType: StreamType.Opus,
});