What Will I Learn?
- How to play
.MP3files from command line with Termux
You can download Termux Here
What Is Termux?
Just before we proceed to the steps taken to play
.mp3 files with Termux, Its best adviced to actually know which of the folders the mp3 file is located. So lets check where the mp3 file we are going to use is stored.
The audio file we are going to play via Termux comand line is
Goodlife.mp3 And it's saved in this directory
Since we've located the file, lets check out the steps.
1: Install and launch Termux. Type this command
clear to delete every initial text on the screen.
mpv by typing this command
pkg install mpv
Mpv is simply a music player.
3: After typing the above command line, while its running, you will be told that some specific amount of disk space will be used. In my case it required 26.2mb. So reply
y to grant it access.
Download in progress.
4: Once it has downloaded successfully, type this command
cd / to set your Termux environment to root storage.
5: Now type
ls to list the available files and folders in the root storage. Then type
cd storage to open storage folder.
6: Now its time to select which of the storage folder our audio file ( goodlife.mp3) is located. since its located in sdcard1 now type
ls to list the available files and folders in the storage folder, Then type
cd sdcard1 to open sdcard1 folder.
ls to list the available files and folders in the sdcard folder, Now type
cd music to access the music folder. Because we saved our audio file in there.
9: This is the final stage. Type
ls to list the files in the music folder as usual. After i typed it, i was able to see our mp3 file Goodlife.mp3. To play this file, we have to call the mpv we downloaded at the beginning of this tutorial to play the audio file by typing
10: The audio file should start playing after that command.
This is the first tutorial i'm contributing using Ternmux.
Posted on Utopian.io - Rewarding Open Source Contributors