Recording Audio on Linux with PulseAudio
Recording audio on Linux doesn’t require Audacity, OBS, or any heavyweight GUI. PulseAudio (and its PipeWire-compatible replacement) ships with everything you need: pactl to inspect sources and parec to capture them.
List available audio sources
1 | |
Typical output on a laptop:
1 | |
| Field | Index | Example | Meaning |
|---|---|---|---|
| Source index | 0 | 74 |
Numeric ID used with parec --device |
| Name | 1 | alsa_output...monitor |
If name ends in .monitor → system output; otherwise → microphone |
The .monitor suffix is the key distinction: monitor sources capture whatever is playing through your speakers, while plain sources are your microphone or line-in.
Record with parec
1 | |
| Argument | Value | Notes |
|---|---|---|
--device |
74, 75, etc. |
The source index from pactl list sources short |
--file-format |
wav |
Always WAV; parec only supports WAV and raw PCM |
<output-path> |
~/Recordings/recording_20260517_120530_<name>.wav |
File written directly to disk |
Record system output and mic simultaneously
Run two parec processes in parallel:
1 | |
To stop both, send SIGTERM to the processes (e.g., kill %1 %2).
Key behaviors
- WAV files are written continuously during recording — no buffered finalization step.
- Files are immediately usable after the process ends. No post-processing, transcoding, or header repair is needed.
parecrecords in the source’s native format (sample rate, channel count, bit depth) and writes it faithfully to the WAV container.
Recording Audio on Linux with PulseAudio
https://jifengwu2k.github.io/2026/05/17/Recording-Audio-on-Linux-with-PulseAudio/