Hi,
I'm working on an application which will sort my music after Artist, Album etc. I'm currently working on getting ID3v2 tags from the mp3 files.
I found alot of documentation on the subject, but I don't understand it all :P
Here's some info I found on ID3's website.
Here's a c++? example of a decoder.
And here's Wikipedia's information :P
I can't get my head around this, so anyone knows how to Decode/Encode this? :)
Thanks :)
I'm working on an application which will sort my music after Artist, Album etc. I'm currently working on getting ID3v2 tags from the mp3 files.
I found alot of documentation on the subject, but I don't understand it all :P
Here's some info I found on ID3's website.
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.
Here's a c++? example of a decoder.
int unsynchsafe(unsigned int in) { int out=0, i; unsigned int mask=0x7F000000; for(i=0; i<4; ++i) { out >>= 1; out |= in & mask; mask >>= 8; } return out; }
And here's Wikipedia's information :P
Synchsafe integers appear in ID3 tags that are attached to an MP3 file. An ID3 tag[1] encodes several blocks of data. Some blocks (containing metadata about the content of the file) are variable in length and are encoded as 'synchsafe' integers to distinguish them from data in other blocks. In a synchsafe integer, the most significant bit of each byte is zero, making seven bits out of eight available. So, for example, a 32-bit synchsafe integer can only store 28 bits of information. Examples: (%11111111) is encoded as a 16-bit synchsafe integer (%00000001 01111111). (%11111111 11111111) is encoded as a 24-bit synchsafe integer (%00000011 01111111 01111111). The ID3 specifications require that multibyte numbers such as these be stored in big-endian order,[1] so the bytes will be ordered exactly as laid out in the examples above.
I can't get my head around this, so anyone knows how to Decode/Encode this? :)
Thanks :)