$linuxjunkies
>

pw-record(1)

Record audio from PipeWire sources to a file.

UbuntuDebianFedoraArch

Synopsis

pw-record [OPTION]... [FILE]

Description

pw-record is a PipeWire utility that captures audio from a source node and writes it to a file. It connects to the PipeWire audio server, selects an input device or source, and records the audio stream in various formats including WAV, FLAC, and raw audio.

The command automatically negotiates the sample rate, bit depth, and channel configuration with the source. Output format is typically determined by the file extension, though it can be specified explicitly with options.

Common options

FlagWhat it does
-h, --helpShow help message and exit
-v, --verboseIncrease verbosity; can be used multiple times
-q, --quietSuppress output messages
-r, --rate RATESet sample rate in Hz (e.g., 44100, 48000)
-c, --channels CHANNELSSet number of channels (1 for mono, 2 for stereo, etc.)
-f, --format FORMATSet sample format (S16, S32, F32, etc.)
-p, --properties PROPSSet PipeWire node properties as key=value pairs
-t, --target TARGETConnect to specific source node by name or ID
--max-latency LATENCYSet maximum latency in milliseconds
--min-quantum QUANTUMSet minimum quantum (buffer size) in samples

Examples

Record audio to recording.wav from the default input source

pw-record recording.wav

Record mono audio at 16kHz sample rate (common for voice)

pw-record -c 1 -r 16000 voice.wav

Record 32-bit stereo audio at 48kHz (studio quality)

pw-record -f S32 -r 48000 -c 2 stereo.wav

Record from a specific audio input device by its ID

pw-record -t alsa_input.pci-0000_00_1f.3.analog-stereo output.wav

Record to FLAC format with verbose output to monitor the process

pw-record -v recording.flac

Record with lower latency (100ms) at CD quality sample rate

pw-record --max-latency 100 -r 44100 podcast.wav

Record from a source matching the description 'Line In'

pw-record -p node.description='Line In' recording.wav

Related commands