$linuxjunkies
>

aplay(1)

Play audio files or streams on a Linux sound card using ALSA.

UbuntuDebianFedoraArch

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

FlagWhat it does
-l, --list-deviceslist all PCM playback devices available
-L, --list-pcmslist all PCM configurations
-d DEVICE, --device=DEVICEspecify the PCM device to use (default: default)
-c CHANNELS, --channels=CHANNELSset number of audio channels (1=mono, 2=stereo, etc)
-f FORMAT, --format=FORMATspecify audio format (U8, S16_LE, S24_LE, etc)
-r RATE, --rate=RATEset sample rate in Hz (e.g., 44100, 48000)
-q, --quietsuppress progress messages
-v, --verboseshow verbose messages during playback
-t TYPE, --file-type=TYPEspecify file type (wav, au, raw, voc, gsrt)
-D, --use-strftimeuse strftime for file names (for recording)

Examples

play a WAV file with default settings

aplay song.wav

list all available audio playback devices

aplay -l

play audio on specific hardware device (card 1, subdevice 0)

aplay -d hw:1,0 song.wav

play audio from a pipe (stdin)

cat audio.wav | aplay

play file with verbose output showing progress

aplay -v song.wav

play raw audio: 2 channels, 48kHz sample rate, 16-bit signed

aplay -c 2 -r 48000 -f S16_LE song.raw

play two files sequentially in quiet mode

aplay -q song.wav && aplay outro.wav

decode video audio and play it through aplay

ffmpeg -i video.mp4 -f wav - | aplay

Related commands