pw-play
Play audio files using PipeWire
TLDR
View documentation for the original command
SYNOPSIS
`pw-play [options]
Example: `pw-play -V 0.5 -l my_song.wav`
This plays `my_song.wav` at half volume and loops it continuously.
PARAMETERS
-h, --help
Displays a help message with available options.
-v, --verbose
Enables verbose output for detailed operation information.
--version
Shows the `pw-play` version information.
-d
Specifies the playback duration in seconds.
-p
Starts playback from a specific position in seconds within the file.
-o
Skips the initial offset in seconds from the beginning of the file.
-l, --loop
Loops the audio playback continuously until manually stopped.
-V
Sets the initial playback volume (e.g., 0.5 for half volume).
-c
Sets the desired number of audio channels for playback.
-r
Sets the desired sample rate for playback.
-m
Specifies a custom channel map (e.g., FL,FR,FC for front left, front right, front center).
-F
Sets the sample format (e.g., S16LE for 16-bit signed little-endian, F32LE for 32-bit float little-endian).
-n
Assigns a specific name to the PipeWire node created for this playback.
-N
Sets a description for the PipeWire node.
-P
Allows setting arbitrary PipeWire node properties (e.g., node.target=my_sink).
-L
Sets the target latency for the audio stream in seconds.
-q, --quiet
Suppresses statistical output during playback.
DESCRIPTION
`pw-play` is a command-line utility designed to play audio files through the PipeWire multimedia framework. It acts as a client to the PipeWire sound server, providing low-latency and efficient audio playback. This command is part of the broader PipeWire ecosystem, which aims to provide a modern solution for audio and video processing, replacing older systems like PulseAudio and JACK.
Users can specify one or more audio files for playback. `pw-play` automatically handles the connection to the PipeWire daemon and sets up the necessary audio streams. It supports various audio formats, leveraging underlying libraries such as libsndfile. Its integration with PipeWire allows it to participate in the PipeWire graph, enabling complex routing and processing setups when needed, although its primary function is simple playback. It's a fundamental tool for testing audio output and playing media in environments where PipeWire is the active sound server.
CAVEATS
`pw-play` requires a running PipeWire daemon to function correctly. If PipeWire is not active, the command will fail to connect and play audio.
The ability to play specific audio file formats depends on the underlying libraries and PipeWire modules installed, primarily libsndfile for common formats like WAV, AIFF, FLAC.
Playback quality and output device selection are managed by PipeWire's routing capabilities, which might require further configuration within PipeWire for advanced setups.
EXIT STATUS
`pw-play` typically exits with a status of 0 upon successful completion of playback. A non-zero exit status usually indicates an error, such as failure to connect to the PipeWire daemon, an invalid file path, or an unsupported file format.
ENVIRONMENT VARIABLES
While `pw-play` itself doesn't typically rely on specific environment variables for its core functionality, the underlying PipeWire library and daemon might be influenced by variables like PIPEWIRE_DEBUG for debugging purposes, or PIPEWIRE_LATENCY for global latency adjustments. However, these are generally not specific to `pw-play`'s direct usage.
HISTORY
PipeWire, and consequently `pw-play`, emerged as a modern multimedia framework for Linux, aiming to handle audio and video streams more efficiently and securely than previous solutions like PulseAudio for desktop audio and JACK for professional audio. Development began around 2017, driven by the need for better low-latency audio/video capabilities, especially for Wayland compositors and Flatpak applications.
`pw-play` was introduced as a simple, native utility for basic audio playback within this new ecosystem, providing a familiar command-line interface for playing sound files while leveraging PipeWire's advanced graph capabilities for routing and processing. It represents PipeWire's commitment to providing robust and user-friendly tools for multimedia handling.