aplay(1)
Play audio files or streams on a Linux sound card using ALSA.
Synopsis
aplay [OPTION]... [FILE]...Description
aplay is a command-line audio player for ALSA (Advanced Linux Sound Architecture). It reads audio data from files or stdin and plays it through your system's audio device. It supports WAV, AU, and raw audio formats.
If no file is specified, aplay reads from standard input. Multiple files can be played sequentially by listing them as arguments.
Common options
| Flag | What it does |
|---|---|
-l, --list-devices | list all PCM playback devices available |
-L, --list-pcms | list all PCM configurations |
-d DEVICE, --device=DEVICE | specify the PCM device to use (default: default) |
-c CHANNELS, --channels=CHANNELS | set number of audio channels (1=mono, 2=stereo, etc) |
-f FORMAT, --format=FORMAT | specify audio format (U8, S16_LE, S24_LE, etc) |
-r RATE, --rate=RATE | set sample rate in Hz (e.g., 44100, 48000) |
-q, --quiet | suppress progress messages |
-v, --verbose | show verbose messages during playback |
-t TYPE, --file-type=TYPE | specify file type (wav, au, raw, voc, gsrt) |
-D, --use-strftime | use strftime for file names (for recording) |
Examples
play a WAV file with default settings
aplay song.wavlist all available audio playback devices
aplay -lplay audio on specific hardware device (card 1, subdevice 0)
aplay -d hw:1,0 song.wavplay audio from a pipe (stdin)
cat audio.wav | aplayplay file with verbose output showing progress
aplay -v song.wavplay raw audio: 2 channels, 48kHz sample rate, 16-bit signed
aplay -c 2 -r 48000 -f S16_LE song.rawplay two files sequentially in quiet mode
aplay -q song.wav && aplay outro.wavdecode video audio and play it through aplay
ffmpeg -i video.mp4 -f wav - | aplay