Record Discord Audio Using ffmpeg and PulseAudio

This article explains how to record audio from a Discord channel on Linux using ffmpeg and PulseAudio. By identifying the correct PulseAudio monitor source corresponding to your system’s audio output, you can capture high-quality Discord conversations directly from the command line and save them into your preferred audio format.

Step 1: Identify Your PulseAudio Monitor Source

To record Discord’s output, you must target the “monitor” of your active audio playback device. PulseAudio automatically creates a monitor source for every output device.

Open your terminal and run the following command to list all available audio sources:

pactl list short sources

Look for a line that ends with .monitor. For example, if your default output device is an analog stereo output, you might see a source named:

alsa_output.pci-0000_00_1f.3.analog-stereo.monitor

If you have trouble finding it, you can filter the list to show only monitor sources:

pactl list short sources | grep monitor

Copy the full name of the monitor source you want to record.

Step 2: Record the Audio with ffmpeg

Once you have the monitor source name, you can use ffmpeg to capture the stream. Use the -f pulse input format and specify the monitor source with the -i flag.

Run the following command, replacing YOUR_MONITOR_SOURCE with the name you copied in Step 1:

ffmpeg -f pulse -i YOUR_MONITOR_SOURCE -acodec libmp3lame -ab 192k discord_record.mp3

Command Breakdown:

Press Ctrl + C in your terminal to stop the recording when you are finished.

Optional: Record to a Lossless Format

If you plan to edit the recorded audio later, it is recommended to record to a lossless WAV format to preserve original audio quality:

ffmpeg -f pulse -i YOUR_MONITOR_SOURCE discord_record.wav