Re: [OT]Non-padded odd-length chunks in AIFFs
Re: [OT]Non-padded odd-length chunks in AIFFs
- Subject: Re: [OT]Non-padded odd-length chunks in AIFFs
- From: Ev <email@hidden>
- Date: Thu, 2 Dec 2004 17:14:32 -0600
On Dec 2, 2004, at 2:04 PM, email@hidden wrote:
Yes, at its most basic level, the AIFF specification defines chunks as
having
a 4-char name, 4-byte (big-endian) length, and data which is always
padded to
an even length. Even if the 4-byte length in the chunk header is odd
(which is
rare, but allowed), the file itself should start the next chunk at an
even
byte offset.
In my dealing with AIFFs and seeing all sorts of weird versions of
files, it is true that a block CAN have a padded byte, but it is not
necessary. That's the trick about the spec. In real life, it is not
ALWAYS padded to an even length.
I've seen it both ways in different kinds of blocks - as I've seen
different spec descriptions. *Some* blocks can have a pad, and others
don't say that they can.
I'm tending toward the REAL 4-byte length, odd or not, and the REAL
size, odd or not, being what is in the file - no pads necessary. It
makes it easier to walk the blocks and avoid accidentally skipping and
reading a wrong block type. That's how I'm doing it anyway. I wish
everyone had followed the spec, but now we're left with what the real
world has to give us. Urgh.
Ev
Technical Knowledge Officer
Head Programmer/Designer
Audiofile Engineering
http://www.audiofile-engineering.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden