Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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)

Replies are listed 'Best First'.
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.
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.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://582479]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2018-05-20 22:12 GMT
Find Nodes?
    Voting Booth?