The online racing simulator
mp3 id3 tag reader.
(13 posts, started )
mp3 id3 tag reader.
I'd like to read the header of an MP3 file to extract information from it. I have some mp3s on my laptop, and some other mp3s on my desktop computer that I would like to compare. I know some of the files I have a 320Kbps and the others are only 192Kbps, so I would like to only keep the 320 files and sync the rest of the higher quality files to both computers. Only problem I don't have a clue how to read the head of an MP3 ID3 Tag .
#2 - wien
Using what language? Here's a library for C++: http://id3lib.sourceforge.net/. You could also get the specification here and do it yourself. I wouldn't recommend that though.

Is the bit rate a part of the ID3 tags though? I would have thought that was stored in the MP3 header or something?
Writing a program to read the spec isn't that hard, a bit tricky in places, but nothing too crazy. I wrote an MP3 tag reader a couple of years ago as a project, it was pretty fun and worked great. I've no idea where it is now though, probably burnt onto some long lost disk. I believe the bitrate is a part of the header, if I remember correctly.
-
(wheel4hummer) DELETED by wheel4hummer
The ID3 tag is very simple to read. Just go to the end of the file, and it is right there.

http://www.id3.org/ID3v1

I'm making a program to read the tag right now, and it should only take a few minutes.

EDIT:Oh, you want to read the header. I just saw the part that said ID3 tag. I'll still make an ID3 tag reader just for the hell of it though.
#7 - wien
Quote from wheel4hummer :I'm making a program to read the tag right now, and it should only take a few minutes.

Don't most people use ID3v2 tags these days though? Or is that just in non-english speaking countries that require Unicode? I haven't used a v1 tag in years.
whatever
I'm a PHP guy .
#10 - wien
Quote from Dygear :I'm a PHP guy .

Looks like this is what you need. According to the documentation the MP3_Id class has a $bitrate member.
Yeah, I looked at all of the classes that you guys have place up here, and I have to say alot of them seem over kill for the project that I'm trying to do. I think you all for your help. I should just shut about about the code size and just use one of them.
#12 - wien
Quote from Dygear :Yeah, I looked at all of the classes that you guys have place up here, and I have to say alot of them seem over kill for the project that I'm trying to do. I think you all for your help. I should just shut about about the code size and just use one of them.

It may be overkill, but the PEAR one seems relatively light weight. Unless it's for practice/fun, anything is better that writing it yourself in my opinion. (Up to a certain point of course. )
This is kinda for practice and some fun, that and I could really use it myself, and my boss would also like it for his own reasons, but I'll do this on my own time and open source it. I'm going to make my own one seeing as I don't like that the ID3 one Requires PEAR, there is no reason for that really. While I must say that he did a very good job, I looked over the code, I don't think that PEAR should be required to read a freaking mp3 file. Nor do I think you need 200 files to read a mp3 file (In the case of getid3). That's just stupid.

Just going to make a class that will open an mp3 file and read it's ID3 tag, should not be to hard to do. ID3v1 should be really easy, It's ID3v2 that should be a bit of a pain.


<?php 
$id3_v1 
unpack('a30Title/a30Artist/a30Album/a4Year/a30Comment/IGenre'file_get_contents('01 Music.mp3'falsenull0 128));
?>


mp3 id3 tag reader.
(13 posts, started )
FGED GREDG RDFGDR GSFDG