fix(voice): remove OggDemuxer from transmitter pipeline
Opus.Encoder in prism-media outputs raw Opus packets directly, no OGG wrapping. OggDemuxer was breaking the stream by trying to unwrap a non-existent OGG container. Pipeline was: PCM → Encoder → OggDemuxer → Discord (broken) Pipeline now: PCM → Encoder → Discord (correct) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
314d2baec4
commit
25eb3f6353
@@ -36,19 +36,16 @@ export class VoiceTransmitter {
|
||||
// Upsample 24kHz mono → 48kHz stereo
|
||||
const upsampledStream = this.upsampleTo48kStereo(this.pcmStream);
|
||||
|
||||
// Encode to Opus and wrap in OGG container
|
||||
// Encode to Opus — Encoder outputs raw Opus packets (no OGG wrapper needed)
|
||||
this.opusEncoder = new prism.opus.Encoder({
|
||||
rate: 48000,
|
||||
channels: 2,
|
||||
frameSize: 960,
|
||||
});
|
||||
|
||||
const oggDemuxer = new prism.opus.OggDemuxer();
|
||||
const opusStream = upsampledStream
|
||||
.pipe(this.opusEncoder)
|
||||
.pipe(oggDemuxer);
|
||||
const opusStream = upsampledStream.pipe(this.opusEncoder);
|
||||
|
||||
// Play to Discord with Opus format (raw Opus packets)
|
||||
// Play to Discord with raw Opus format
|
||||
discordPlayer.playStream(opusStream, "browser-bridge", {
|
||||
inputType: StreamType.Opus,
|
||||
inlineVolume: true,
|
||||
|
||||
Reference in New Issue
Block a user