How to make a playlist from a directory of mp3 files?

How to make a playlist from a directory of mp3 files?

cd to the directory and

ls -1 *.mp3 > playlist.m3u

It turns out that there exists a fairly universal format called m3u format, and it can be as simple as a list of filenames separated by newlines.

After my wife had moved the mp3 files she wanted onto an empty thumb drive, I opened a terminal, browsed to the media directory, and typed the following and hit enter:

ls -1 *.mp3 > playlist.m3u

I then opened the file for her in gedit and let her copy and paste the lines around as much as she wanted to get them into her desired order.

When she was done, she saved the file, double-clicked it in a folder browser, and RhythmBox opened it. She clicked play, and it played, and I was a hero.


Shuffle Playlist

Bash script example for Pi Musicbox with USB HDD (generatePlaylist.sh)...

find /music/USB/mp3/* -iname *.mp3 -type f | shuf | head -n 200 > /music/playlists/mp3_shuffle.m3u

combined with crontab job to run every 4 hours...

0 */4 * * *     root    /music/playlist/generatePlaylist.sh