|
-
Jun 10th, 2007, 10:56 AM
#1
Thread Starter
New Member
ID3v2 Size bytes
Hi, i'm just messing around trying to make me own mp3 ID3v2 tag retriever. I have managed to read the id3v2 header and then retrieve some tag data from the tag frames. but the way im doing it is i read the overal size of the tag frames from the id3v2 header and then loop through that many bytes reading the tag info. this works fine it seems, but then instead of retrieving tags i seemed to be reading non-tag data. i am not sure why because i assumed that all of the bytes specified in the size (in the id3v2 header) would be tag bytes/data.
i'm guessing that this means i am reading the size from the id3v2 header frame incorrectly. the way i do it is...
the size is stored in 4 bytes (but 7 (most significant bit) is always 0 because it's syncsafe). they use 4 bytes because it is supposed to be one 32-bit number, and so simply adding the 4 bytes together won't give the correct result. right? that's what i thought anyway so i made my own funciton (i don't know if there is some built in function) to read 4 bytes and return them as a single integer representing to correct 32-bit number. In this i include bit 7 from each byte (not sure if i am meant to include this bit).
Anyway the function works as it is expected to but what i want to know is.. am i going about retrieving the size correctly? or am i doing it all wrong, if it is wrong it might explain why i read data past the end of the tag frames.
sorry if this makes no sense, please let me know if you want me to explain something.
thanks for any help!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|