Generate a playlist of mp3 files

In my car, I can play music via a “parrot” device from a usb stick. The
available sort options are “artist, album, genre or playlist”. I would
like random, but there is no such option. So I wonder if I can generate
externally a playlist file which is internally randomly sorted.

So what I want, I think, is an utility to generate .m3u files from a
list of directories randomly or otherwise sorting the tracks.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

On Fri, 08 Feb 2013 23:48:06 +0000, Carlos E. R. wrote:

> In my car, I can play music via a “parrot” device from a usb stick. The
> available sort options are “artist, album, genre or playlist”. I would
> like random, but there is no such option. So I wonder if I can generate
> externally a playlist file which is internally randomly sorted.

Sure, that sort of thing is possible. Banshee can be used to create
playlists (which you could randomize from your library) and then you can
export the playlist. I’m assuming your device can use an m3u playlist -
if it doesn’t, you’ll have to give us info about what it does support.

Then you would just need to check the playlist and see that the
directories are relative rather than absolute, and copy the structure
onto the USB stick.

Jim

Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

On 2013-02-09 06:43, Jim Henderson wrote:
> On Fri, 08 Feb 2013 23:48:06 +0000, Carlos E. R. wrote:
>
>> In my car, I can play music via a “parrot” device from a usb stick. The
>> available sort options are “artist, album, genre or playlist”. I would
>> like random, but there is no such option. So I wonder if I can generate
>> externally a playlist file which is internally randomly sorted.
>
> Sure, that sort of thing is possible. Banshee can be used to create
> playlists (which you could randomize from your library) and then you can
> export the playlist. I’m assuming your device can use an m3u playlist -
> if it doesn’t, you’ll have to give us info about what it does support.

I just tried with banshee and I could not create such a playlist from a
location.

Tried then amarok, and I could select “local music”, then “files”, then
select all the directories with the mouse, then right click to add to
collection. It started thinking for a minute, then the playlist was
created. So I have a big .m3u file.

Amarok also can use other formats, such as shoutcast and xspf. I don’t
know which my parrot device wants, the documentation does not say.

The list is not random, but alphabetic: all tracks numbered “1” from
each directory, then all numbered “2”, etc. I don’t see how to influence
the sorting. Ah, yes, I can select random tracks in amarok, yes…

Hum. I don’t really know what sort order is used for the playlist when
exported. :-? Ah, yes, it is alphabetical by artist, even if the
playlist plays random in Amarok.

Let’s try banshee again.

What I don’t see in banshee is how to generate a playlist from a
directory (and recursive). I have to click on the artists or tracks and
add them one by one, and there are hundreds - plus I can make a mistake
and add the tracks from a different directory I don’t want to add.

I found that “easytag” can also generate a playlist of directory,
recursively, which is what I want. But the list is sorted by directory,
which I do not want. No sorting selector. It can use “dos directory
separator” which is a feature I might need.

kid3 can select a parent directory, if you choose menu entry “file/open
directory”. But sorting order is by directory, can not be altered.

So the best one so far is amarok…

You might say that I might randomize the file with linux tools, but the
file generated by amarok has two lines per entry.

Hum! With easytag or kid3 I can select “write only list of files”, then
randomize the file using… using what? I thought I knew, but I can’t
remember. I need a Linux filter to randomize a text file, too.

I don’t see anything appropriate in “apropos random”, only random number
generators…

Thanks! You gave me several ideas :slight_smile:

Hum! “man 6 random” perhaps…


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

On 2013-02-09 13:23, Carlos E. R. wrote:
> I don’t see anything appropriate in “apropos random”, only random number
> generators…

I solved this part. I wrote a pascal program to generate a randomized
text file out of a sorted file (if any one is interested I’ll upload it
somewhere - no error checking). Now I have to try this out in the car
parrot device.

(The parrot is a brand name of a hands free device for use with the
cellular phone in cars. It integrates with the car radio silencing it
when a call comes. It also doubles as a mp3 usb reader for car radios
that don’t have that, like mine. Absurdly even new cars come with a CD
reader and no USB plug).


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)