«« Effective Placebo? Post^H^H^H^H Essay Writing »»
blog header image
id3v2 Issues

Reading id3v2 tags for MP3 files isn't too bad, but I can already tell that writing will be a bit of a challenge. id3v2 tags are divided into frames, with each frame having a sort of name/value pair. In id3v1, all of the values are strings. In id3v2 values can be any data at all.

One of the goals of the id3v2 component is to separate it from AudioMan so it may be used elsewhere. So I didn't want dependencies on AudioMan-specific things. As well the id3v2 spec has changed quite a bit (4 revisions so far) over the years which can lead to problems using some of its own information.

Something that changed a lot in the id3v2 spec were the frame id strings, which started as three character and then went to four. These inconsistencies between versions makes using the id strings in the API difficult, so I've decided not to do that.

Instead I've used a simple Map of name/value pairs. The name is a string for the field, like "TRACK_NUMBER" and the value is a string. So when the API is used, the data must be converted from AudioData to this format to id3v2, or the reverse. This creates a very loose dependency from AudioData to id3v2 and a loose dependency between revisions of id3v2.

Another issue is when I write data to the id3v2 tag. There will be a lot of frames I won't have to change, so I'll just copy them from the original instead of remaking them from scratch. This will prevent me from deleting data I don't understand and don't have any business trying to rewrite.

Posted at April 23, 2004 at 07:15 AM EST
Last updated April 23, 2004 at 07:15 AM EST
Comments

I'm all confused. What's the point of storing any type of data in the value field. I mean, what types of data are there really. I can't see any information that you'd want to store about a song, that wouldn't be a string. Maybe track numbers, or song length. But that can be easily represented with strings. Also, how is the user supposed to enter other types of information to store? Can they store pictures and stuff? Or other MP3 files? Seems to me that anything entered on the keyboard will be a string, and that I really can't see the need for any other information about the song.

» Posted by: Kibbee at April 25, 2004 10:19 AM

"Can they store pictures and stuff?"

Yes, they can! Pretty weird, eh?

» Posted by: roy at April 25, 2004 12:02 PM

Why not reusing/building upon an existing library like http://javamusictag.sourceforge.net/index.html ?
(found that via http://sourceforge.net search)
At least it could be useful for giving ideas.

» Posted by: Besfred at April 25, 2004 12:44 PM

I'm not against using a library but I haven't found a good one yet. Never heard of this one before, I'll check it out. Thanks man.

» Posted by: Ryan at April 25, 2004 05:46 PM

From looking at the bugs submitted for that project it's pretty clear it's not ready for prime time. Plus, the maintainer seems to have taken a vacation from it.

The risk looks to be unacceptably high.

» Posted by: Ryan at April 25, 2004 05:56 PM
Google
 
Search scope: Web ryanlowe.ca