mp3info and python

Dave Pawson DaveP at dpawson.freeserve.co.uk
Thu Dec 6 00:55:50 EST 2001


"Brett g Porter" <BgPorter at NOartlogicSPAM.com> wrote 

> I can't get the mp3info.tar file that's on the Vaults to expand
> correctly, so I can't venture how they handle things, but I do have a
> lot of experience with MP3 data.

I think its a tgz file with a .tar extension, or the mime type
is screwing it up.
Only managed to get it via a linux download.

> 
> Can you get the bit rate from mp3info?

yes (neat)
 Assuming that you can, and it's
> a constant bit rate file, the length in seconds is filesize / (bitrate
> / 8). 

Nice to know, thanks.

> 
> If there's ID3 data at the end of the file, subtract that from the
> filesize before calculating.

Is that of a fixed size please?
the functions imply that the header info is stored in the id3 'header'
if thats the right term.

> 
> If it's a variable bit rate file, you will need to scan through the
> file and count frames, multiplying by the constant # of milliseconds
> per frame. 

No, its not vbr, and I've not seen such a constant in the
file.

Re my original question, is the total time of the file fixed
in this id3 data, or is it the sum of each frame, possibly where
each frame might be a song on a CD album?
Other id3 heading stuff implies that might be the case.
In which case, how do I skip from one set of header data to another?

regards DaveP




More information about the Python-list mailing list