Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: MP3 shuffler

by derby (Abbot)
on Nov 06, 2006 at 16:13 UTC ( #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.


Comment on Re: MP3 shuffler
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.


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2015-11-29 04:15 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (746 votes), past polls