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
soxusing your package manager with all the encoders.For Ubuntu:
1sudo apt-get update1sudo apt-get install sox libsox-fmt-allAfter the installation is complete, use the
playcommand to play an audio file.1play filename.mp3