Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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.

-derby


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

      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
      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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (14)
As of 2014-07-30 17:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (237 votes), past polls