goosefairy has asked for the wisdom of the Perl Monks concerning the following question:

It looks like MP3::Info will do it. Now, I just need to check with my boss and see if what he was asking for is what he wanted.

Thanks all.

Susan

Janitor note: Original content follows:

I need to be able to parse the information from an uploaded mp3 file to determine if it was encoded according to our specifications.

How do I go about doing this?

Susan

Original content restored by Arunbear. (Keep/Edit/Delete: 0/50/2)

  • Comment on how do i parse header information from an mp3 file

Replies are listed 'Best First'.
Re: how do i parse header information from an mp3 file
by Corion (Patriarch) on Jul 14, 2005 at 19:13 UTC

    Use one of the modules, for example MP3::Info or AudioFile::MP3. If you want/need pure Perl, you can also decode the information manually, but as every mp3 file consists of many parts, all with their respective header (which makes such hacks as variable bitrate (vbr) possible), that's a tedious thing to do yourself.

Re: how do i parse header information from an mp3 file
by InfiniteLoop (Hermit) on Jul 14, 2005 at 19:26 UTC
    There are number of CPAN modules to read ID3 tags. Check them out here: MP3
Re: how do i parse header information from an mp3 file
by Grygonos (Chaplain) on Jul 14, 2005 at 20:39 UTC

    You can also check the specification ID3 Tag Spec and roll your own. It's not hard for ID3v1. ID3v2 is a little more difficult.