If you want to play your audio in the command-line terminal application, then install Sox (Sound eXchange) on your system. Using Sox, you can play, read, and write audio files in most popular formats. You can use this application as a command-line audio processing tool.
Install Sox on Ubuntu
Open the terminal application (ctrl+alt+t) and run below command.It will install Sox on your system.
sudo apt install sox libsox-fmt-all -y
You can check the installed version using below command.
sox --version
Playing Audio Files Through Sox in Terminal
In the terminal play any audio file using below command format.
play ~/path/to/file/filename.mp3
Example:
Play the BabyElephantWalk60.ogg file, which is located in the system’s Music folder.
play ~/Music/BabyElephantWalk60.ogg
It supports many popular audio file formats. You can quit the player while the song is playing by using the Ctrl+C keys.
If you want to play all files from the Music folder one by one, then run below command.
play ~/Music/*