From 9a5942faccf4184dbee9c99d63570f4b23d1c93a Mon Sep 17 00:00:00 2001 From: Bradley Bickford Date: Wed, 22 Nov 2023 21:40:34 -0500 Subject: [PATCH] Trying something because the files I'm getting are playable, but only under specify conditions and not with FFMEG --- breadbot.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/breadbot.js b/breadbot.js index 7579f1c..add8fa0 100644 --- a/breadbot.js +++ b/breadbot.js @@ -137,7 +137,13 @@ client.on(Events.VoiceStateUpdate, async (oldState, newState) => { }, crc: false })) - .pipe(fs.createWriteStream("." + path.sep + "media" + path.sep + "voice_audio" + path.sep + newCallID + path.sep + `${Date.now()}-${user_id}.ogg`)) + .pipe(new prism.opus.OggDemuxer()) + .pipe(new prism.opus.Decoder({ + channels: 2, + rate: 4800, + frameSize: 960 + })) + .pipe(fs.createWriteStream("." + path.sep + "media" + path.sep + "voice_audio" + path.sep + newCallID + path.sep + `${Date.now()}-${user_id}.pcm`)) }) } catch (error) {