Play audio files (MP3, WAV, OGG, FLAC, M4A) on Linux using available command-line tools such as aplay, ffplay, mpg123, or cvlc. Use this skill whenever the user wants to listen to, play back, or preview an audio file.
Play audio files from the command line. Automatically selects the best available player.
MP3, WAV, OGG, FLAC, M4A, AAC, WMA, OPUS, and any format supported by the underlying tool.
Try tools in this order and use the first one found:
for cmd in ffplay mpg123 aplay cvlc; do command -v "$cmd" && break; done
# ffplay (suppress GUI and verbose output)
ffplay -nodisp -autoexit -loglevel quiet /path/to/file.mp3
# mpg123
mpg123 -q /path/to/file.mp3
# aplay (WAV/PCM files only)
aplay /path/to/file.wav
# cvlc (VLC headless)
cvlc --play-and-exit /path/to/file.mp3
# ffplay with volume
ffplay -nodisp -autoexit -volume 50 /path/to/file.mp3
# mpg123 with scale
mpg123 -q --scale 16384 /path/to/file.mp3
# Start at 30 s, play for 10 s
ffplay -nodisp -autoexit -ss 30 -t 10 /path/to/file.mp3
amixer sset Master unmute on ALSA systems).aplay is the most reliable choice for WAV files.