LinuxCommandLibrary

paplay

Play audio files through PulseAudio server

SYNOPSIS

paplay [options] FILE...

PARAMETERS

-h, --help
    Displays a help message and exits.

--version
    Shows the program's version information and exits.

-v, --verbose
    Enables verbose output for debugging and detailed information.

-s SERVER, --server=SERVER
    Specifies the PulseAudio server to connect to.

-d DEVICE, --device=DEVICE
    Selects the audio output device (sink) for playback.

-n NAME, --client-name=NAME
    Assigns a custom client name, visible in PulseAudio tools.

-ss NAME, --stream-name=NAME
    Assigns a custom stream name for this playback session.

-p PROPERTY, --property=PROPERTY
    Sets a specific PulseAudio property on the audio stream.

--volume=VOLUME
    Sets the playback volume (0-65536, where 65536 is 100%).

--rate=RATE
    Overrides the sample rate of the audio stream.

--format=FORMAT
    Forces a specific sample format (e.g., s16le, float32ne).

--channels=CHANNELS
    Sets the number of audio channels.

--raw
    Treats the input file as raw (headerless) audio data.

--loop
    Continuously loops the playback of the audio file(s).

--file-format=FORMAT
    Overrides auto-detection of the input file format.

--latency=LATENCY
    Requests a specific playback latency in milliseconds.

--process-id=PID
    Associates the stream with a specific process ID.

--no-remix
    Disables channel remixing by the PulseAudio server.

--no-srb
    Disables server-side resampling and remixing.

--realtime
    Requests real-time scheduling for the playback thread.

--high-priority
    Requests high priority for the playback thread.

DESCRIPTION

paplay is a command-line utility for playing audio files through the PulseAudio sound server. It's designed to be simple and integrates seamlessly with the PulseAudio ecosystem, allowing users to play various audio formats. It can play local files and supports specifying the target server, output device, volume, and various audio stream properties like sample rate, format, and channels. It's often used for quick audio playback, scripting, or testing PulseAudio setups. Being a core component of PulseAudio, it benefits from the server's capabilities such as network audio, per-application volume control, and dynamic device switching. It supports common audio formats like WAV, FLAC, and Ogg Vorbis, relying on libsndfile for decoding, and offers options for raw audio playback and continuous looping.

CAVEATS

Requires a running PulseAudio sound server to function.
File format support is dependent on libsndfile and PulseAudio's build options; MP3 playback usually requires external plugins or transcoding.
Offers only a command-line interface; no graphical controls.
The --loop option repeats the entire list of files if multiple are provided.

EXIT STATUS

paplay typically exits with status 0 on successful playback. A non-zero exit status indicates an error, such as a file not found, an invalid argument, or an inability to connect to the PulseAudio server.

EXAMPLES

To play a simple WAV file:
paplay audio.wav

To play an FLAC file on a specific output device with verbose output:
paplay -v --device=my_speakers song.flac

To continuously loop an Ogg Vorbis file:
paplay --loop jingle.ogg

HISTORY

paplay is a fundamental utility within the PulseAudio sound system, which was originally introduced as 'Polly' in 2004 and rebranded to PulseAudio in 2006. As a core component, paplay has been present since the early stages of PulseAudio's development, providing basic sound playback functionality. Its evolution has been closely tied to PulseAudio's goals of offering advanced audio features like network transparency, per-application volume control, and improved hardware abstraction.

SEE ALSO

parec(1), pacmd(1), pactl(1), pulseaudio(1), aplay(1), play(1)

Copied to clipboard