Home

RIFFCHUNKS

RIFFCHUNKS refers to the chunk-based data container used by the Resource Interchange File Format (RIFF). RIFF is a generic multimedia container designed to store audio, video, and related data in a modular way. It was developed by Microsoft and IBM and has become a foundational structure for several common formats, notably WAV audio and AVI video. A RIFF file is organized as a sequence of chunks, each identified by a four-character ASCII ID and followed by a 32-bit little-endian size and then that many bytes of data. The top-level RIFF chunk itself includes a form type, such as WAVE or AVI, which indicates how the enclosed chunks should be interpreted.

The typical structure begins with the literal ASCII string RIFF, then a 4-byte size, then a 4-byte

Common chunks in WAV files include fmt , which describes audio format parameters such as codec, channels,

form
type.
After
that,
the
file
contains
a
series
of
subchunks.
Each
subchunk
has
its
own
4-byte
ID,
a
4-byte
size,
and
a
payload
of
the
indicated
size.
If
a
chunk’s
size
is
odd,
a
padding
byte
is
inserted
to
maintain
even
alignment
for
subsequent
data.
LIST
chunks
introduce
nesting
by
containing
subchunks
after
a
4-byte
LIST
type
field,
enabling
hierarchical
organization
within
the
RIFF
file.
sample
rate,
byte
rate,
block
align,
and
bits
per
sample,
and
data,
which
holds
the
actual
audio
samples.
Other
chunks
may
carry
metadata,
timing
cues,
or
non-audio
information.
RIFF’s
chunk-based
design
supports
extensibility
by
allowing
new
chunk
IDs
without
breaking
older
parsers,
contributing
to
its
long-standing
use
in
multimedia
storage.