How To Run Sound Files In CLI/Linux Terminal? - Fosslicious

Friday, May 11, 2018

How To Run Sound Files In CLI/Linux Terminal?

Many ways we can do to run the sound file in the command line or linux terminal. But, usually will require an application to read the file format you want to play. In this case, I tried using an app called sox.

How To Run Sound File In CLI/Linux Terminal?

So, we need is to install the application first. Please type the command in the following terminal to install sox, and make sure you are connected on the internet, because we will install it online:

sudo apt-get install sox
Based on the screenshot above, you can see the size of this file quite small about 500 kb, after installed will require 1,493 kb space. Once installed, you can test to run one of the sounds stored in the directory by typing this command:
play mymusic.wav
The above command is an example to run a file name with the .wav format. If the sound format that you want to run does not exist, you can install it via terminal with the following command:

sudo apt install libsox-fmt-all