Playing music or sounds from the command line is simple with Sound eXchange (
SoX). It supports many audio file types: mp3, wav, ogg, etc.
As described by its man page, Sound eXchange is the Swiss Army knife of audio manipulation. It’s a cross platform command line utility used to convert, apply affects, record, or play audio files.
How to play audio from the terminal
soxusing your package manager with all the encoders.
sudo apt-get update
sudo apt-get install sox libsox-fmt-all
After the installation is complete, use the
playcommand to play an audio file.