[ID3 Dev] ID3v2 Best Practices

Mathias Kunter mathiaskunter at yahoo.de
Tue Jul 28 09:41:29 PDT 2009


> What I am not understanding, and why I was writing the e-mail, is why
my implementation is working fine if I do not change the size of the
ID3v2 tag header upon rewriting a MP3 file, but does not work fine if I
do change the size header.  The program uses the same process in both
cases.  I have looked at the binary dump of what I am writing, and
compared it with Id3v2 data that Winamp/WMP will honor and do not
notice anything irregular.


The fact that Winamp or other software can read an ID3 tag doesn't mean that it's correctly coded.
Since you say the problem occurs when you change the tag size field, make sure that you write it correctly.

1) Determine the correct size of your tag if you re-write it. The tag size is the sum of the size of the extended header (if there exists one), all frames, and the padding (if there exists one). Don't forget the frame headers itself, which are not included within the frame size field.

2) Code this value either as a sync-safe 4 byte integer or as a normal 4 byte integer. See the following table:

ID3 version 2.2
    tag header: sync-safe int
    frame headers: normal int (note: 3 instead of 4 bytes long!)
ID3 version 2.3
    tag header: sync-safe int
    frame headers: normal int
ID3 version 2.4
    tag header: snyc-safe int
    frame headers: snyc-safe int

Regards,
Mathias K.






________________________________
Von: Glenn Someone <ggrotz73 at hotmail.com>
An: id3v2 at id3.org
Gesendet: Sonntag, den 26. Juli 2009, 17:15:04 Uhr
Betreff: RE: [ID3 Dev] ID3v2 Best Practices

 Understood and thanks for your response.
 
What I am not understanding, and why I was writing the e-mail, is why my implementation is working fine if I do not change the size of the ID3v2 tag header upon rewriting a MP3 file, but does not work fine if I do change the size header.  The program uses the same process in both cases.  I have looked at the binary dump of what I am writing, and compared it with Id3v2 data that Winamp/WMP will honor and do not notice anything irregular.
 
This makes me think that either I am misunderstanding something in the standard, or my implementation is off in a way that I am not seeing upon studying the data (for almost two weeks now).  This is why points #2 and #3 were written in the original e-mail.  Is there something that can be used (somewhere) to validate whether ID3v2 is correct or not?  If not, would it be possible for someone to look at a bit of data and see what is wrong about it?



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.id3.org/pipermail/id3v2/attachments/20090728/f8753baf/attachment.html>


More information about the ID3v2 mailing list