#Recording bot issues

18 messages · Page 1 of 1 (latest)

vocal vector
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

cloud bridge
#

[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 ❤️

delicate thicket
#

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

cloud bridge
#

@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

delicate thicket
#

please use child_process to use ffmpeg on your script

delicate thicket
#

so you have to use ffmpeg

cloud bridge
#

@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 💜

delicate thicket
#

I have tried it, but I get the information that 'There's no way to record all the VC'

cloud bridge
delicate thicket
#

This will be your help

cloud bridge
#

I will try that when i get the pc, i'm studing but thanks you dude you helped me a lot 🥹