From 16b41fad2b42c10dea8a9c13db34c62d04207bae Mon Sep 17 00:00:00 2001 From: Bradley Bickford Date: Tue, 21 Nov 2023 18:46:06 -0500 Subject: [PATCH] Modifying versions and restoring the PCM version of audio saving --- breadbot.js | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/breadbot.js b/breadbot.js index ada5208..8031cd2 100644 --- a/breadbot.js +++ b/breadbot.js @@ -127,13 +127,13 @@ client.on(Events.VoiceStateUpdate, async (oldState, newState) => { duration: 1000 } }) - /*.pipe(new prism.opus.OggDemuxer()) + .pipe(new prism.opus.OggDemuxer()) .pipe(new prism.opus.Decoder({ rate: 48000, channels: 2, frameSize: 960 - }))*/ - .pipe(fs.createWriteStream("." + path.sep + "media" + path.sep + "voice_audio" + path.sep + newCallID + path.sep + `${Date.now()}-${user_id}.ogg`)) + })) + .pipe(fs.createWriteStream("." + path.sep + "media" + path.sep + "voice_audio" + path.sep + newCallID + path.sep + `${Date.now()}-${user_id}.pcm`)) }) } catch (error) { diff --git a/package.json b/package.json index a6864ba..c367fda 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "libsodium-wrappers": "^0.7.13", "mysql": "^2.18.1", "mysql2": "^3.6.3", - "prism-media": "^1.3.5" + "prism-media": "^2.0.0-alpha.0" }, "devDependencies": { "eslint": "^8.27.0"