• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Tutorial: M3U Playlists on Android

Bottom line up front (bluf): to launch a playlist you can't click on it from the file listing and expect Meridian to know what to do with it (gives message unsupported file type). The key is to open Meridian, then click on playlists, and your M3U playlists will appear. Clicking on a playlist will begin to play your music.

Here's the step by step method to copy files and create a playlist on the SD card of your android phone:

On your computer (I'm using PC) create a folder called music, then sub folders for different artists, genres, etc. (if you already have it organized, great, just make sure you don't copy more files than you have disk space on the phone)

Next create a m3u playlist. Each line in an m3u is a reference to a song:
music/artist/song 1.mp3
music/artist/song 2.mp3

Here's how I automatically created a playlist for a large folder of songs:

Open command prompt, navigate to music folder then to the sub folder with the songs you want to add to your playlist. Type the following:

dir /OD /B > ../myplaylist.m3u

*dir command will list the contents of the directory,
**the > redirects the output into a file called myplaylist.m3u (in the parent directory). If the file does not exist, it will be created. *Caution* if the file does exist, it will be overwritten. To add to the end of an existing file use >> instead
*** the /B switch spits out just the file name (omitting file size, etc)
**** the /OD switch changes the sort order, to be (in this case) date which is just a personal preference, you can omit if you like.

At this point, you have a file with all the songs in it, but it is not yet a playlist which Meridian can handle because we also need to add the prefix of the path to each song.

So, I use MS Word at this point and open the playlist I just created. Use the Find and Replace option, and find ^p (new line) and replace it with ^p /sd/music/artist/ press "replace all." This should add the correct path in front of each song except the very first song in the file... change that one manually. Scroll to the bottom of the file and you will find one extra path on the very last line of the file... delete that one. Next, save as plain text (not as MS Word format)

Optional step, if you have any non-ascii characters, you will need to open the file in Notepad and save as type... all files, encoding UTF-8. Otherwise, Meridian will skip over any files with characters it can't understand.

Ok, almost done... now just copy the folder with your playlist and the subfolder(s) with your music to your SD card. Plug in USB cable, choose mount, and then when prompted by your PC, choose open with folder view. Note: the path in your playlist has to match the actual path on your sd card.

Now, unplug the USB cable, allow Android to complete the scan of the sd card, then in applications, open Meridian, select Playlists icon, then browse to the sd card, find the playlist you created and click on it. You cannot use the file browser to click on the playlsit and expect it to play. You also cannot click on the playlist from the library icon. It only works (on my phone) by going through the playlist option.

Hope this helps someone, spent all afternoon figuring this out, thought it was worth posting for others.
 
  • Like
Reactions: kmbclub
Thanks for posting.

Couple of things to point out

* this appears to be instructions for Windows machines.

* the stock Music app seems to be fine with relative paths (if the .m3u is on the card in the same dir as the music files it requires no full path)

* there is technically a "magicline" type header at the top of .m3u files, but I think most apps can figure it out without

Looks like this when scripted in linux. Produces datestamped playlist so I can tell them apart:

MYDATE=`date +%Y%m%d%H%M`
PLAYLIST=${MYDATE}.m3u

# quasi-magicline
echo "#EXTM3U" > $PLAYLIST
# season to taste
ls *.mp3 *.ogg *.MP3 *.OGG *.mp4 *.MP4 >> $PLAYLIST

#thank you, drive through
 
Upvote 0
Here are some additional thoughts...

1. Using Notepad, list the files in the dir and save-as a .m3u file with type = UTF-8. Only the song names need to be listed and the basic Android music player will find them! (as mentioned in the above post)

2.Using some sort of Playlist creator...remember to save in .m3u. Not all will "shuffle"...

3.Use WMP to generate a sorted list, copy and paste the song names to Notepad and edit, same as above...

4.Use iTunes and it exports both .m3u and .txt files as UTF-8, so no conversion is necessary. Create your new playlist, remember to hit "shuffle", and then Export it to .m3u. You can simply use this "playlist" or

edit it further...taking that playlist and opening it in Notepad, "select all" and copy to a blank spreadsheet. With all still highlighted, go to Data Tab, choose Text-Column, and choose "Delimited", and click next. Untick Tab, Tick Other: and put # in the box, and click next - then click finish. This will push all of the EXTINF info into column B. Sort everything by column B and delete all of the "EXTINF" lines by deleting Column B. This will leave you your sorted songs. Now use Text to Column again to eliminate the extra DIR info (if you are anally retentive) leaving just the filename.mp3, and... Bob's your Uncle.

I use MP3tag Editor to fix any file info and add album covers. (I have tried many and found this one to be the best)
 
Upvote 0
So I tweaked this a little bit hopefully it helps out someone.

dir /s /OD /B *.mp3 >playlist.m3u

same command I just added two items

/s --will list recursive, so the you can run this from the parent music folder. The command will go and get a file name and location for every song under that folder and any other folders within.

*.mp3 --this filters the list to only mp3 since all of my music is mp3 it works out for me, but if you have aac or wma you can change that accordingly and it will list those files.

>playlist.m3u just does a dump to a file.

I use Notepad ++, it's a great application just as simple as notepad, but you can do a lot more with it.

Thanks for the starter command.

-Patrick:)
 
  • Like
Reactions: alostpacket
Upvote 0
I have my MP3s in directories on my PC - and those directories are my playlists - I use the following commands to create the .m3u files for Android:

1 - open a command prompt; working directory the folder where the MP3 folders are
2 - create a new folder called "Playlists"
3 - for /f %d in ('dir /ad /b') do dir %d\*.mp3 /b /on > Playlists\%d.m3u
4 - delete Playlists\Playlists.m3u

I move the entire directory structure to my phone. The .m3u files in the Playlists folder are used by the music apps to manage the playlists.

I don't like to admit it, but I use iTunes to manage my music, album art, info, etc. I wrote scripts to read the iTunes XML files and create my directory structure based on my iTunes playlists. If anyone has a better program to manage music, please chime in - I don't like iTunes.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones