How to play .MP3 files from command line with Termux

in utopian-io •  8 months ago

What Will I Learn?

  • How to play .MP3 files from command line with Termux

Requirements

  • Termux
    You can download Termux Here

Difficulty

  • Intermediate

What Is Termux?

Capture.PNG


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 \Home\SD card\music

IMG_20180122_133029_668.jpg

Since we've located the file, lets check out the steps.

STEPS

1: Install and launch Termux. Type this command clear to delete every initial text on the screen.
1.jpg

2: Install mpv by typing this command pkg install mpv
Mpv is simply a music player.
2.jpg

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.
3.png

Download in progress.
Screenshot_2018-01-22-13-52-22.png

4: Once it has downloaded successfully, type this command cd / to set your Termux environment to root storage.
4.png

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 cd storage

5.png

7: Type ls to list the available files and folders in the storage folder, Then type cd sdcard1 to open sdcard1 folder.
l.png

8: Type 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.
8.png

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 mpv goodlife.mp3
9.png

10: The audio file should start playing after that command.
Screenshot_2018-01-22-13-55-15.png

Curriculum

This is the first tutorial i'm contributing using Ternmux.



Posted on Utopian.io - Rewarding Open Source Contributors

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

mmmh, i won't talk, i will keep shut. ☺

Hey @rufans I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Suggestions

  • Contribute more often to get higher and higher rewards. I wish to see you often!
  • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!

Get Noticed!

  • Did you know project owners can manually vote with their own voting power or by voting power delegated to their projects? Ask the project owner to review your contributions!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x