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
|
// Upsample 24kHz mono → 48kHz stereo
|
||||||
const upsampledStream = this.upsampleTo48kStereo(this.pcmStream);
|
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({
|
this.opusEncoder = new prism.opus.Encoder({
|
||||||
rate: 48000,
|
rate: 48000,
|
||||||
channels: 2,
|
channels: 2,
|
||||||
frameSize: 960,
|
frameSize: 960,
|
||||||
});
|
});
|
||||||
|
|
||||||
const oggDemuxer = new prism.opus.OggDemuxer();
|
const opusStream = upsampledStream.pipe(this.opusEncoder);
|
||||||
const opusStream = upsampledStream
|
|
||||||
.pipe(this.opusEncoder)
|
|
||||||
.pipe(oggDemuxer);
|
|
||||||
|
|
||||||
// Play to Discord with Opus format (raw Opus packets)
|
// Play to Discord with raw Opus format
|
||||||
discordPlayer.playStream(opusStream, "browser-bridge", {
|
discordPlayer.playStream(opusStream, "browser-bridge", {
|
||||||
inputType: StreamType.Opus,
|
inputType: StreamType.Opus,
|
||||||
inlineVolume: true,
|
inlineVolume: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user