From 08a9d0addd4604131bdb84fa1db5764b9cad235f Mon Sep 17 00:00:00 2001 From: Bradley Bickford Date: Sun, 19 Nov 2023 18:37:26 -0500 Subject: [PATCH] Another slight modification to make sure voice audio data is stored in a sensible location --- breadbot.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/breadbot.js b/breadbot.js index d23cbde..ff06ba6 100644 --- a/breadbot.js +++ b/breadbot.js @@ -91,7 +91,7 @@ client.on(Events.VoiceStateUpdate, async (oldState, newState) => { var newCallID = await sqlutil.registerNewCall(newState.guild.id, newState.channelId, new Date()) // This should always have something to do, as all callIDs should be unique - fs.mkdirSync("." + path.sep + "media" + path.sep + newCallID, {recursive: true}) + fs.mkdirSync("." + path.sep + "media" + path.sep + "voice_audio" + path.sep + newCallID, {recursive: true}) connection = newState.channel.join().then(conn => { const receiver = conn.receiver @@ -100,7 +100,7 @@ client.on(Events.VoiceStateUpdate, async (oldState, newState) => { if (speaking) { const audioStream = receiver.createStream(user, { mode: "pcm"}) - const pathToFile = "." + path.sep + "media" + path.sep + newCallID + `${user.id}-${Date.now()}.pcm` + const pathToFile = "." + path.sep + "media" + path.sep + "voice_audio" + path.sep + newCallID + `${user.id}-${Date.now()}.pcm` audioStream.pipe(fs.createWriteStream(pathToFile)) audioStream.on("end", () => {