Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: ID3v2 TAG unpack uninitialized value

by no_slogan (Deacon)
on Jan 05, 2014 at 15:46 UTC ( #1069393=note: print w/ replies, xml ) Need Help??


in reply to Re: ID3v2 TAG unpack uninitialized value
in thread ID3v2 TAG unpack uninitialized value

Actually, you want to unpack them as four bytes. unpack "CCCC". ID3 has this wacky format that stores a 28-bit integer with 7 bits per byte, which I see the OP is already aware of.

The pack "I" format is not nearly as useful as you might think, because the length and byte order are both platform-dependent. You usually want to stick with "N" or "V".


Comment on Re^2: ID3v2 TAG unpack uninitialized value
Replies are listed 'Best First'.
Re^3: ID3v2 TAG unpack uninitialized value
by thanos1983 (Hermit) on Jan 06, 2014 at 00:06 UTC

    Thanks for the tip no_slogan, I actually print tried all of them and I got the same result for (I An unsigned integer and for V A long integer in VAX order). Output can be viewed under:

    This is the content of lines_0 with I: 990183424 This is the content of lines_1 with I: 826626132 This is the content of lines_2 with I: 167772160 This is the content of lines_3 with I: 1090519040 This is the content of lines_0 with V: 990183424 This is the content of lines_1 with V: 826626132 This is the content of lines_2 with V: 167772160 This is the content of lines_3 with V: 1090519040

    When I tried to print the (N A long integer in network order) option I got this result:

    This is the content of lines_0: 1339 This is the content of lines_1: 1414546737 This is the content of lines_2: 10 This is the content of lines_3: 65

    The reason that I was using the (I An unsigned integer) characters is that on the official website description says:

    http://id3.org/id3v2.4.0-structure
    %x is used to indicate a bit with unknown content. ID3v2 size 4 * %0xxxxxxx
    The ID3v2 tag size is stored as a 32 bit synchsafe integer (section 6. +2), making a total of 28 effective bits (representing up to 256MB).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1069393]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (16)
As of 2015-07-29 17:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (265 votes), past polls