Old 29th October 2005, 14:21   #1
Chris1977
Junior Member
 
Join Date: Oct 2005
Location: Bremen, Germany
Posts: 5
WinAmp and ID3v2

Hi all,

I'm currently developing an ID3 tagging software (I know that there's already plenty of this around but none of them meets my demands).

While testing it, I learned that WinAmp does obviously not conform to the ID3v2 standards which can be found at http://www.id3.org . More precise, the specification of ID3v2.3 claims that the so called "synchsafe scheme" be used, but WinAmp does not.

Can anyone tell me the exact differences between the WinAmp ID3v2 scheme and the actual specification? Are there any plans in the future to make WinAmp conform to the ID3v2 standard?

Thanks & regards,
Chris
Chris1977 is offline   Reply With Quote
Old 29th October 2005, 14:37   #2
gaekwad2
Foorum King
 
gaekwad2's Avatar
 
Join Date: Jul 2003
Location: bar2000
Posts: 11,381
Do you mean unsynchronisation?
Quote:
from http://www.id3.org/id3v2.3.0.html
Unsynchronisation may only be made with MPEG 2 layer I, II and III and MPEG 2.5 files.
So it only applies to mp3 with 24khz or less sample rate.
gaekwad2 is offline   Reply With Quote
Old 29th October 2005, 16:14   #3
Safai
Senior Member
 
Join Date: Sep 2000
Location: Canada
Posts: 249
Send a message via ICQ to Safai
I assume you're talking about the frame sizes that are supposed to be syncsafe. id3v2.3 (and below) does not use syncsafe integers. id3v2.4 (and possibly above) uses them. You have to check the tag version before calculating the frame sizes.

http://www.id3.org/id3v2.3.0.html#sec3.3
Safai is offline   Reply With Quote
Old 30th October 2005, 07:11   #4
Chris1977
Junior Member
 
Join Date: Oct 2005
Location: Bremen, Germany
Posts: 5
Thanks for your answers, but I'm pretty confused now.

ID3v2.0 specification ( http://www.id3.org/id3v2-00.txt ) says the following:

The ID3 tag size is encoded with four bytes where the first bit (bit 7) is set to zero in every byte, making a total of 28 bits. The zeroed bits are ignored, so a 257 bytes long tag is represented as $00 00 02 01.

Almost the same can be found in the ID3v2.3 specification ( http://www.id3.org/id3v2.3.0.txt ):

The ID3v2 tag size is encoded with four bytes where the most significant bit (bit 7) is set to zero in every byte, making a total of 28 bits. The zeroed bits are ignored, so a 257 bytes long tag is represented as $00 00 02 01.

Both descriptions don't coin the term "synchsafe", but actually this is exactly what they refer to, innit?

So as far as I understand in *all* ID3v2.x versions synchsafe ints are used to specify the size of the tag, but only ID3v2.4 also uses synchsafe ints in order to indicate the size of a frame.

???
Chris1977 is offline   Reply With Quote
Old 30th October 2005, 15:43   #5
Safai
Senior Member
 
Join Date: Sep 2000
Location: Canada
Posts: 249
Send a message via ICQ to Safai
Yes. Tag size is always syncsafe.

From a simple test i have, winamp seems to be producing syncsafe tag size (as in the high-bit is never set in the tag size). What's the problem you are having?
Safai is offline   Reply With Quote
Old 4th November 2005, 19:30   #6
Chris1977
Junior Member
 
Join Date: Oct 2005
Location: Bremen, Germany
Posts: 5
Sorry for the delayed answer, but it took me a while to figure my problem out and create a descriptive dump image.

On the left side of the image that is shown below you can see what my tagging app reads from an MP3 I tagged with WinAmp 5.094. On the right side a "byte dump" of the concerned part of the file is shown. I'm puzzled about the first byte of each frame content which are depicted as black rectangles in the text dump and as blue rects in the byte dump. These are no content bytes (their code is "0") -- where do they belong to?





ID3v2.3 spec says that each frame header contains

- a frame ID (4 bytes)
- the size of the frame (4 bytes)
- flags (2 bytes)

so we got 6 bytes after the frame ID, but except from the TPOS frame we got 7, so there's one byte too much in each frame, in the WXXX frame there are even two of these mysterious bytes. I also wonder about the superfluent bytes in the beginning of the COMM frame.

As you can read in my earlier posts, I suspected a misinterpretation of tag/frame sizes, but this resolved to be not the cause -- all sizes are fine.

WinAmp does not display these bytes in the tag editor, it only displays the "normal letters".

Am I scatterbrained or this a WinAmp-ish modification of ID3v2?
Chris1977 is offline   Reply With Quote
Old 5th November 2005, 03:16   #7
Safai
Senior Member
 
Join Date: Sep 2000
Location: Canada
Posts: 249
Send a message via ICQ to Safai
For text field type frames (T000 - TZZZ), the first byte in your 'data' is the encoding method, 0 for ansi, 1 for unicode.

http://www.id3.org/id3v2.3.0.html#sec4.2

For comment (COMM), http://www.id3.org/id3v2.3.0.html#sec4.11

For URL (WXXX), http://www.id3.org/id3v2.3.0.html#WPUB

basically, read the corresponding section for that frame to determine how to read/parse the 'content'.

Hope this helps...
Safai is offline   Reply With Quote
Old 5th November 2005, 10:25   #8
Chris1977
Junior Member
 
Join Date: Oct 2005
Location: Bremen, Germany
Posts: 5
Ha, that's due to my not reading the complete spec but only certain parts of it. Thanks for sorting that out, Safai.
Chris1977 is offline   Reply With Quote
Old 6th November 2005, 09:57   #9
Chris1977
Junior Member
 
Join Date: Oct 2005
Location: Bremen, Germany
Posts: 5
There are two another questions which have arisen...

(1) As ID3v2.3 hasn't got a tag footer in contrast to ID3v2.4, I'd like to know whether there's any safe method to find out if there's a ID3v2.3 tag located after the audio data without having to scan the file backwards from the end? This would imply that the last byte(s) of the audio data are 'constant', but frankly spoken I'm already very busy with the ID3v2 specs and thus not very motivated to scrutinise MP3 file specs. Does anyone know?

(2) Are there any plans to make WinAmp conforming to ID3v2.4?
Chris1977 is offline   Reply With Quote
Old 6th November 2005, 10:53   #10
gaekwad2
Foorum King
 
gaekwad2's Avatar
 
Join Date: Jul 2003
Location: bar2000
Posts: 11,381
Id3v2.3 and older can't be put after the audio data.
gaekwad2 is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump