How to create an m3u playlist containing mp3 and m4a files?

3.1k views Asked by At

how can I create a .m3u playlist file with .mp3 and .m4a files in it using debian linux please?

I tried this but the end-result is non-playable ls -w 1 *.m4a *.mp3> ~/.mpd/playlists/beeb-radio.m3u.

It lists all the files with the correct extensions but when I try to load it in MPD, it says that the song is non-playable.

2

There are 2 answers

0
boudiccas On

The source directory is ~/Music/beeb-radio/ and the target directory is ~/.mpd/playlists

and the relevant code is -

cd ~/Music 
ls -1 beeb-radio/*.{mp3,m4a} > ~/.mpd/playlists/beeb-radio.m3u'

This creates the file 'beeb-radio.m3u' which is instantly playable by MPD if put into its playlist directory.

2
GinoGinetta On

I use the mkpl tool.

For your purpose the command is like this:

mkpl -d beeb-radio/ -a -r -f mp3 m4a ~/.mpd/playlists/beeb-radio.m3u

-d or --directories -> Directories that contains multimedia files

-f or --format -> Select only a file format

-a or --absolute -> Absolute file name

-r or --recursive -> Recursive search

~/.mpd/playlists/beeb-radio.m3u -> playlist file