Encyclopedia > RIFF

  Article Content

RIFF

RIFF stands for Resource Interchange File Format. It is a simple format for storing tagged data structures, introduced[1] in 1991 by Microsoft and IBM.

RIFF file consist of building blocks called chunks. Chunk can be described as the following C structure[2]:

struct chunk {

 char id[4]; // four character code describing chunk content
 unsigned long size; // length of the content, excluding id, size and padding
 char data[size]; // chunk content, padded to the word boundary
};

Chunks having id of either "RIFF" or "LIST" store any number of other chunks.

"RIFF" chunk defines the whole file container. First four bytes of the chunk data form a file type identifier (eg."AVI "[3], "WAVE" etc), after which there are chunks describing the file placed one after another.

"LIST" chunk is just an ordered collection of other chunks, for example a collection of movie frames. First four bytes of the data is a collection identifier (eg."movi" for frame data etc), after which chunks of the collection follow.

To learn more about other chunk types and RIFF format, please refer to the following Microsoft's documents:

  • Resource Interchange File Format Services (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/mmio_2uyb.asp)
  • RIFF AVI file reference (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dx8_c/directx_cpp/htm/avirifffilereference.asp)
  • Reading WAVE files (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dx8_vb/directx_vb/htm/_dx_reading_wave_files_dxaudio.asp)
  • DirectMusic file format (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dx8_c/directx_cpp/htm/_dx_directmusic_file_format_dxaudio.asp)
  • Multimedia Registration Kit (http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q120253)

Footnotes:

  1. RIFF format is almost identical to IFF file format introduced earlier by Electronic Arts, and very popular mostly among Amiga users.
  2. All data in a RIFF file is in little-endian notation, thus simply dumping this structure to disk will not work on big-endian machines.
  3. Less than four character identifiers are padded with spaces.



All Wikipedia text is available under the terms of the GNU Free Documentation License

 
  Search Encyclopedia

Search over one million articles, find something about almost anything!
 
 
  
  Featured Article
Lake Ronkonkoma, New York

... out of which 35.6% have children under the age of 18 living with them, 59.8% are married couples living together, 10.9% have a female householder with no husband ...

 
 
 
This page was created in 35.4 ms