Now the Linux desktop has developed very well, and it is easy to play music on the desktop. Do we still remember how we played music when the desktop was not so good? Ah, I cannot remember it. It's so hard.
But now we can first install a small software and then use it to play music through the command line.
The software is named SOX and supports audio files in many formats, such as WAV, MP3, MPG, OGG, and FLAC. It is enough to satisfy our daily usage.
Well, first, we need to install it into our system.
1. Open a terminal (Ctrl + Alt + T) and enter the following command:
sudo apt-get install sox
2. The administrator password is required to install software for the system. Enter the password and press Enter.
3. Enter Y when you ask if you want to continue the installation.
4. Okay, just wait for it to complete the installation. After the installation is complete, we can use the following command to enable SOX to play the supported audio format files:
sudo apt-get install sox libsox-fmt-all
5. Now we can use SOX to play the audio files in our computer.
6. For example, to play all the audio files in the system, run the following command:
play *mp3
7. If you want to play a specific file, use the following command:
play file-name.extension
For example:
play Aqua_Barbie_Girl.mp3
You can only play the MP3 file aqua_barbie_girl.pdf.
8. During playback, press Ctrl + C to play the current audio to the next audio.
9. For more SOX operation commands, you can use the man command to view details. I hope you will find something.
man sox