Play sounds or music from Linux terminal
Playing music or sounds from the command line is simple with Sound eXchange (SoX
). It supports many audio file types: mp3, wav, ogg, etc.
What is SoX
?
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
Install
sox
using your package manager with all the encoders.For Ubuntu:
1sudo apt-get update
1sudo apt-get install sox libsox-fmt-all
After the installation is complete, use the
play
command to play an audio file.1play filename.mp3