PulseAudio sound server. It understands all audio file formats supported by .is a simple tool for playing back or capturing raw or encoded audio files on a
It is also present under the aliases
pacat is installed by default with PulseAudio, as part of the package.
See the man page for information on
paplayis equivalent to
parecordis equivalent to
pacat -r --file-format
parecis equivalent to
pacat -r --raw
pamonis equivalent to
- When invoking
pacatdirectly, the defaults are equivalent to
pacat -p --raw.
parec both record by default, whereas
paplay play back by default.
paplay both deal with encoded audio, whereas
pacat work on raw PCM (and thus can be used in pipelines).
Note that a single instance of
pacat cannot record and play back at the same time; for that, see #Playing back an audio input.
Select a sink or source
Configuring which sink to play to, or which source to record, can be done using a PulseAudio front-end, or programmatically using the
To list the available sinks:
$ pactl list sinks short
To list the available sources:
$ pactl list sources short
short keyword produces detailed output about each sink/source.
There are two ways to refer to a given sink/source: either by name, or by ID. Taking the following source list as an example:
$ pactl list sources short
0 alsa_output.pci-0000_00_1f.3.analog-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz RUNNING 1 alsa_input.pci-0000_00_1f.3.analog-stereo module-alsa-card.c s16le 2ch 44100Hz RUNNING 2 alsa_output.hw_0_7.monitor module-alsa-sink.c s16le 2ch 48000Hz RUNNING 3 rtp.monitor module-null-sink.c s16le 2ch 44100Hz RUNNING
Then the following two lines produce the same result.
$ parecord -d alsa_input.pci-0000_00_1f.3.analog-stereo speech.flac $ parecord -d 1 speech.flac
Tips and tricks
pacat lets the PulseAudio server pick the latency, "usually relatively high for power saving reasons". If this is not desirable, for example for #Playing back an audio input, one can pass the
latency (in bytes) or
latency-msec option to
pacat. For example:
$ pacat -d 0 --latency-msec 1
Note that this usually only needs to be done when playing back, not when recording.
Playing back an audio input
If you are recording an external audio source (for example via a jack male-male cable), you may want to have feedback on what you are recording. This can be done by using
parec to capture the input, and piping it into
pacat to play it back.
$ parec | pacat
It may be practical to #Select a sink or source directly, for example:
$ parec -d 0 | pacat -d 1
It is possible to record the sound at the same time by adding tee to the pipeline:
$ parec | tee speech.raw | pacat
Though you may want to launch a separate instance of