Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: MP3 shuffler

by rinceWind (Monsignor)
on Nov 06, 2006 at 17:02 UTC ( #582479=note: print w/ replies, xml ) Need Help??


in reply to Re: MP3 shuffler
in thread MP3 shuffler

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)


Comment on Re^2: MP3 shuffler
Re^3: MP3 shuffler
by derby (Abbot) on Nov 06, 2006 at 17:50 UTC

    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
Re^3: MP3 shuffler
by Popcorn Dave (Abbot) on Nov 06, 2006 at 18:59 UTC
    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://582479]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2014-09-17 12:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (74 votes), past polls