[ID3 Dev] Help request

Pisacreta Michele info at pisacretamichele.it
Fri Aug 4 13:30:03 PDT 2006

I am Michele from Italy.

I'm developing a little mp3 player (  c# /.NET ) able to read ID3 tag (ver 2.x).
I'm not going to use UltraID3Lib  because i'm trying developing my own library.

The trouble i have is about 'synchsafe integer'.

On www.id3.org web site I've found:
An ID3v2 tag can be detected with the following pattern:
$49 44 33 yy yy xx zz zz zz zz
Where yy is less than $FF, xx is the 'flags' byte and zz is less than $80.


ID3v2 size             4 * %0xxxxxxx

My routine to evaluate synchsafe integer seems to work correctly....
Application read correctly all frames supported ( GEOB and APIC too...)
but in some files i've found a frame (Always a PRIV) sized more than $7F in last size byte. (eg $8A).

this is an example I've found:

ID3v2   Header Unsynchronisation flag           : 0;
ID3v2   Header Extended header flag             : 0;
ID3v2   Header Experimental indicator flag    : 0;
ID3v2   Header Footer present flag                 : 0;

PRIV .... ..WM/UniqueFileIdentifier.A.M.G.a._.i.d.=.R. . . . .;.A.M.G.p._.i.d.=.P. . . . . .;.A.M.G.t._.i.d.=.T. . .
|----- 10 -----|----------------------------------------------------------------------------------------- 138 ------------------------------------------------------------------------------------------------| 

Value of .... is $00 00 00 8A  

using synchsafe integer my routine doesn't returns 138 but 266, so application skips next frames...
if I convert frame size using standard procedure it works....

So how i can prevent it?
Can you help me?

Thanks and excuse me for my english...

Michele Pisacreta.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.id3.org/pipermail/id3v2/attachments/20060804/f289a4f0/attachment.html>

More information about the ID3v2 mailing list