Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: MP3 shuffler

by derby (Abbot)
on Nov 06, 2006 at 16:13 UTC ( [id://582464]=note: print w/replies, xml ) Need Help??


in reply to MP3 shuffler

++. One question and one comment. Why use file size instead of something that checks the mimetype of the files? And how come vendors don't implement something like a fisher-yates shuffle algorithm for *random tracks*. Maybe it's just me but I really don't want true random play ... just shuffled play.

-derby

Replies are listed 'Best First'.
Re^2: MP3 shuffler
by rinceWind (Monsignor) on Nov 06, 2006 at 17:02 UTC
    Why use file size instead of something that checks the mimetype of the files?

    Is there something - a CPAN module, that will give me the duration of an MP3 or WMA file from its content? Would the mime type yield this information? Please tell!

    I used the file size as a crude and approximate way of sorting the list of tracks by duration: longer tracks = more bytes.

    Also, I'm not clear about your distinction between "shuffled" and "random". By "shuffled" do you mean avoiding picking the same track more than once, because if this is what you mean, my code achieves this with %seen.

    --

    Oh Lord, won’t you burn me a Knoppix CD ?
    My friends all rate Windows, I must disagree.
    Your powers of persuasion will set them all free,
    So oh Lord, won’t you burn me a Knoppix CD ?
    (Missquoting Janis Joplin)

      This website may aid you in your quest. The ID3 V2 tag appears to contain the track length in milliseconds. The MP3::Tag::ID3v2 should probably help you with this.

      Revolution. Today, 3 O'Clock. Meet behind the monkey bars.

      Never mind about the size ... I was reading the code incorrectly. There's MP3::Info and Audio::WMA but I can't tell you how good/bad they are. And yes, by "shuffle", we mean the same thing ... just wondering why manufacturers don't do a better job of implementing it.

      -derby

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://582464]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2024-03-28 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found