pacat
Play audio to a PulseAudio server
SYNOPSIS
pacat [options]
PARAMETERS
--help
Show help options
--version
Show version information
--record
Record audio data instead of playing it. If not set, audio will be played.
--latency-msec=
Specify the target latency in milliseconds
--device=
Specify the PulseAudio device to use (e.g., alsa_output.pci-0000_00_1b.0.analog-stereo)
--format=
Specify the audio format (e.g., s16le, float32ne)
--channels=
Specify the number of audio channels (e.g., 1 for mono, 2 for stereo)
--rate=
Specify the audio sample rate in Hz (e.g., 44100)
--volume=
Set the playback volume (percentage between 0 and 100).
--raw
Do not use any PulseAudio functionality, acts like `cat /dev/dsp`. This is only for testing.
DESCRIPTION
The pacat command is a simple command-line tool for playing or recording raw audio data using the PulseAudio sound server. It allows users to easily send audio data to PulseAudio for playback or capture audio data from PulseAudio for recording. It is a versatile tool for basic audio manipulation and testing within the PulseAudio environment.
pacat primarily acts as a bridge between standard input/output and PulseAudio. It can read audio data from standard input and play it through the default or specified PulseAudio output. Conversely, it can record audio from the default or specified PulseAudio input and write it to standard output. This makes it useful for scripting, quick audio tests, and simple audio processing pipelines. Options allow specification of sample format, channel count, and sample rate to ensure compatibility with different audio sources and devices.
EXAMPLES
- Play a raw audio file:
pacat < audio.raw
- Record audio to a file:
pacat --record > audio.raw
- Play audio file specifying the format:
pacat --format=s16le --rate=44100 --channels=2 < audio.raw