#Recording bot issues
18 messages · Page 1 of 1 (latest)
[email protected] - node v19.1.0
no code?
i'm trying to make a voice recorder bot and the way that bot working is: when someone talks he's record when he start till he stopped and save it as .ogg file and after that save it, and repeat that for every member in the room and i cannot play the voices cuz its a lot of files is there any way better than this? or can i record all the room one time? thanks
mention me if you replied ❤️
This is some guide:
const fs = require("fs");
const prism = require("prism-media");
if(msg.content === "start record") {
const guild = msg.guild;
const vc = msg.member.voice.channel;
const connection = joinVoiceChannel({
guildId: guild.id,
channelId: vc.id,
adapterCreator: guild.voiceAdapterCreator,
selfMute: false,
selfDeaf: false,
});
const receiver = connection.receiver;
receiver.speaking.on('start', (userId) => {
msg.channel.send(`Now listening ${msg.author.tag}`);
startRecognizeStream(guild, connection, userId);
});
async function startRecognizeStream(guild, connection, userId) {
const receiver = connection.receiver;
await fs.promises.mkdir('./recordings', { recursive: true })
const voiceStream = receiver.subscribe(userId, {
end: {
behavior: EndBehaviorType.AfterSilence,
duration: 10000,
}
})
const decoder = new prism.opus.Decoder({ rate: 48000, channels: 1, frameSize: 960 });
const filename = `./recordings/${Date.now()}-${userId}.pcm`;
console.log(`👂 Started recording ${filename}`);
const writer = voiceStream
.pipe(decoder)
.pipe(fs.createWriteStream(`${filename}`));
}
@cloud bridge
record it and use ffmpeg to merge audio to one audio
then play audio
@delicate thicket i made something like this with 250ms end behavior, and the thing is i cannot know how to merge the audio, cuz it results to be like glitchy or laggy
please use child_process to use ffmpeg on your script
currently, discordjs not supported record all of the vc
so you have to use ffmpeg
@delicate thicket ik but i don't know how to use it. i tried a lot
can u give me an example i'll be thankful 💜
I have tried it, but I get the information that 'There's no way to record all the VC'
ok
I made that i wish the ffmpeg docs like discord docs, that will be easy 😔
This will be your help
I will try that when i get the pc, i'm studing but thanks you dude you helped me a lot 🥹