How to Play Audio Files on Ubuntu Terminal Using Sox

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

sox

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

play audio in terminal sox

It supports many popular audio file formats. You can quit the player while the song is playing by using the Ctrl+C keys.

Also Read:  How to Clean all Flatpak Leftover Using Flatsweep

If you want to play all files from the Music folder one by one, then run below command.

play ~/Music/*
If you liked this article, please subscribe to our YouTube Channel. You can also stay connected with us on X (Twitter) and Facebook.



Leave a Reply