3.3 KiB
Discord Voice Recorder
A Discord.js script which can record voice calls. Summon the bot to a voice channel, and voilà! the audio is piped right into your local machine.
Jump to Installation & Usage to get started.
Recording voice calls without prior consent violates privacy. Do not use this bot without approval. I'm not responsible for your insanity.

- Installation and Usage
- Run Locally
-
[Run as Docker Container](#run-as-docker-container)
-
[Bot Commands](#bot-commands)
- Managing the Output
- Thanks
Installation and Usage
Clone the repository :
git clone https://github.com/chebro/discord-voice-recorder/
Create a discord bot. Invite the bot to your server, then:
- Create a
config.json
file and arecordings
folder at the root folder. - Paste the bot token (from developer window) and any bot prefix into
config.json
, like so:
{
"BOT_TOKEN": "<YOUR_BOT_TOKEN>",
"PREFIX": "<BOT_PREFIX>"
}
You can run the bot in any one of the following two ways.
Running the Script Locally
Run npm i
to download necessary node_modules
, then run npm start
, the bot should be online.
Run as a Docker Container
- Build the docker image
docker build -t dvr .
- Bind
/recordings
directory on host to container and start the container with a custom name.
docker run \
--name <CONTAINER_NAME> \
--mount type=bind,source="$(pwd)"/recordings,target=/usr/src/bot/recordings \
dvr
The bot should be online.
- To stop the container, run
docker stop <CONTAINER_NAME>
, you can restart it usingdocker start <CONTINAER_NAME>
.
Bot Commands
-
Start Recording :
<PREFIX>enter <VOICE_CHANNEL_NAME>
-
Stop Recording :
<PREFIX>exit
Managing the Output
The output for each piece of audio stream is written to a unique file in PCM format (48000 Hz, signed 16-bit little-endian, 2 channel [stereo]) and saved to the /recordings
directory.
Merge Recording
To merge all output files to /recordings/merge.pcm
, run:
node /bin/merge.js
Note: Empty your recordings
folder (and remove merge.pcm
) after each session. Running ./bin/merge.js
otherwise, will dump large merge files.
Convert the Merged File to MP3
Head over to FFmpeg.org, and download executables for your OS; If you're on Windows, double-check if the FFmpeg bin is on your path. As discussed in issue #3, to convert pcm to mp3, run:
ffmpeg -f s16le -ar 48000 -ac 2 -i merge.pcm output.mp3
Thanks
Special thanks to @eslachance for the gist. It is what inspired me to make this repo.