Click here to Skip to main content
15,868,103 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am trying to set the header size (ID3v2 tag) for a mp3 file.
The size in descripted as follow:

"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.
Only 28 bits (representing up to 256MB) are used in the size description to avoid the introducuction of 'false syncsignals'."

So I am looking for a solution to set a signed integer value in below format.

Thanks a lot for any help to solve that!!


Daniel.
Posted
Updated 21-Nov-10 10:07am
v2

1 solution

Well, I don't have an answer for you but I found two articles that might at least get you started.

1. MP3 Header Reader[^].

2. Read MP3 Tag information[^].

The second one, in particular, has some links that might be useful.
 
Share this answer
 
Comments
Daniel Leykauf 21-Nov-10 18:02pm    
Thank you! I found a C# solution and it is working fine in C#. But in VB do I have to truncate the values otherwise do I get for the 3rd byte 4 instead of 3 ... crazy:
Dim Length as Integer = 63040
For i As Integer = 3 To 0 Step -1
b(i) = Convert.ToByte(Length Mod &H80)
Debug.Print(b(i)) Length /= &H80
Length = Math.Truncate(Length / &H80)
Next

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900