All Topics  
RIFF

 

   Email Print
   Bookmark   Link






 

RIFF



 
 
The Resource Interchange File Format (RIFF) is a generic meta-format for storing data in tagged chunks.

It was introduced in 1991 by Microsoft
Microsoft

Microsoft Corporation is a multinational corporation computer technology corporation that develops, manufactures, licenses, and supports a wide range of computer software products for computing devices....
 and IBM, and was presented by Microsoft as the default format for Windows 3.1
Windows 3.1x

Windows 3.1x is a line of operating systems produced by Microsoft for use on personal computers. The line began with Windows 3.1, which was released in March 1992 as a successor to Windows 3.0....
 multimedia files. It is based on Electronic Arts
Electronic Arts

Electronic Arts is an international video game developer, marketer, video game publisher and distributor of video games. Established in 1982 by Trip Hawkins, the company was a pioneer of the early home computer games industry and was notable for promoting the designers and programmers responsible for its games....
's Interchange File Format
Interchange File Format

Interchange File Format , is a generic file format originally introduced by the Electronic Arts company in 1985 in order to ease transfer of data between software produced by different companies....
, introduced in 1985, the only difference being that multi-byte
Byte

A byte is a basic unit of measurement of Computer storage in computer science. In many computer architectures it is a Byte addressing memory address space....
 integers are in little-endian
Endianness

In computing, endianness is the byte ordering used to represent some kind of data. Typical cases are the order in which integer values are stored as bytes in computer memory and the transmission order over a network or other medium....
 format, native to the 80x86 processor series used in IBM PCs, rather than the big-endian
Endianness

In computing, endianness is the byte ordering used to represent some kind of data. Typical cases are the order in which integer values are stored as bytes in computer memory and the transmission order over a network or other medium....
 format native to the 68k
68k

The Motorola 680x0/m68k/68k/68K is a family of 32-bit Complex instruction set computer microprocessor central processing unit chips and was the primary competition for the Intel x86 family of chips in personal computers of the 1980s and early 1990s....
 processor series used in Amiga
Amiga

The Amiga is a family of personal computers originally developed by Amiga Corporation. Development on the Amiga began in 1982 with Jay Miner as the principal hardware designer....
 and Apple Macintosh computers, where IFF files were heavily used.

(The specification for AIFF
AIFF

Audio Interchange File Format is an audio file format standard used for storing sound data for personal computers and other electronic audio devices....
, the big-endian
Endianness

In computing, endianness is the byte ordering used to represent some kind of data. Typical cases are the order in which integer values are stored as bytes in computer memory and the transmission order over a network or other medium....
 analogue of RIFF, was published by Apple Computer
Apple Computer

Apple Inc., formerly Apple Computer Inc., is an United States multinational corporation which designs and manufactures consumer electronics and software products....
 in 1988.)

The Microsoft implementation is mostly known through file formats like AVI
Avi

Avi may refer to:* Avi , the pen name of children's author Edward Irving WortisAVI may refer to:* Audio Video Interleave, a multimedia container format...
, ANI and WAV
WAV

WAV , short for Waveform audio format, is a Microsoft and International Business Machines audio file format standard for storing an audio bitstream on personal computer....
, which use the RIFF meta-format as their basis.

files consist entirely of "chunks".






Discussion
Ask a question about 'RIFF'
Start a new discussion about 'RIFF'
Answer questions from other users
Full Discussion Forum



Encyclopedia


The Resource Interchange File Format (RIFF) is a generic meta-format for storing data in tagged chunks.

It was introduced in 1991 by Microsoft
Microsoft

Microsoft Corporation is a multinational corporation computer technology corporation that develops, manufactures, licenses, and supports a wide range of computer software products for computing devices....
 and IBM, and was presented by Microsoft as the default format for Windows 3.1
Windows 3.1x

Windows 3.1x is a line of operating systems produced by Microsoft for use on personal computers. The line began with Windows 3.1, which was released in March 1992 as a successor to Windows 3.0....
 multimedia files. It is based on Electronic Arts
Electronic Arts

Electronic Arts is an international video game developer, marketer, video game publisher and distributor of video games. Established in 1982 by Trip Hawkins, the company was a pioneer of the early home computer games industry and was notable for promoting the designers and programmers responsible for its games....
's Interchange File Format
Interchange File Format

Interchange File Format , is a generic file format originally introduced by the Electronic Arts company in 1985 in order to ease transfer of data between software produced by different companies....
, introduced in 1985, the only difference being that multi-byte
Byte

A byte is a basic unit of measurement of Computer storage in computer science. In many computer architectures it is a Byte addressing memory address space....
 integers are in little-endian
Endianness

In computing, endianness is the byte ordering used to represent some kind of data. Typical cases are the order in which integer values are stored as bytes in computer memory and the transmission order over a network or other medium....
 format, native to the 80x86 processor series used in IBM PCs, rather than the big-endian
Endianness

In computing, endianness is the byte ordering used to represent some kind of data. Typical cases are the order in which integer values are stored as bytes in computer memory and the transmission order over a network or other medium....
 format native to the 68k
68k

The Motorola 680x0/m68k/68k/68K is a family of 32-bit Complex instruction set computer microprocessor central processing unit chips and was the primary competition for the Intel x86 family of chips in personal computers of the 1980s and early 1990s....
 processor series used in Amiga
Amiga

The Amiga is a family of personal computers originally developed by Amiga Corporation. Development on the Amiga began in 1982 with Jay Miner as the principal hardware designer....
 and Apple Macintosh computers, where IFF files were heavily used.

(The specification for AIFF
AIFF

Audio Interchange File Format is an audio file format standard used for storing sound data for personal computers and other electronic audio devices....
, the big-endian
Endianness

In computing, endianness is the byte ordering used to represent some kind of data. Typical cases are the order in which integer values are stored as bytes in computer memory and the transmission order over a network or other medium....
 analogue of RIFF, was published by Apple Computer
Apple Computer

Apple Inc., formerly Apple Computer Inc., is an United States multinational corporation which designs and manufactures consumer electronics and software products....
 in 1988.)

The Microsoft implementation is mostly known through file formats like AVI
Avi

Avi may refer to:* Avi , the pen name of children's author Edward Irving WortisAVI may refer to:* Audio Video Interleave, a multimedia container format...
, ANI and WAV
WAV

WAV , short for Waveform audio format, is a Microsoft and International Business Machines audio file format standard for storing an audio bitstream on personal computer....
, which use the RIFF meta-format as their basis.

Explanation

RIFF files consist entirely of "chunks". The overall format is identical to IFF
Interchange File Format

Interchange File Format , is a generic file format originally introduced by the Electronic Arts company in 1985 in order to ease transfer of data between software produced by different companies....
, except for the endianness as previously stated, and the different meaning of the chunk names.

All chunks have the following format:
  • 4 bytes: an ASCII identifier for this chunk, e.g. "fmt " or "data".
  • 4 bytes: an unsigned, little-endian 32-bit
    Bit

    A bit is a binary numeral system numerical digit, taking a value of either 0 or 1. Binary digits are a basic unit of information Computer data storage and transmission in digital computing and digital information theory....
     integer with the length of this chunk (except this field itself and the chunk identifier).
  • variable-sized field: the chunk data itself, of the size given in the previous field.
  • a pad byte, if the chunk's length is not even.


Two chunk identifiers, "RIFF" and "LIST", introduce a chunk that can contain subchunks. Their chunk data, after the identifier and length, has the following format:
  • 4 bytes: an ASCII identifier for this particular chunk (in the case of the RIFF chunk: for the entire file, such as "AVI " or "WAVE").
  • rest of data: subchunks.


The file itself consists of one RIFF chunk, which then can contain further subchunks: hence, the first four bytes of a correctly-formatted RIFF file will spell out "R", "I", "F", "F".

More information about the RIFF format can be found in the Interchange File Format
Interchange File Format

Interchange File Format , is a generic file format originally introduced by the Electronic Arts company in 1985 in order to ease transfer of data between software produced by different companies....
 article.

RF64
RF64

RF64 is a Broadcast Wave Format-compatible multichannel file format enabling file sizes to exceed 4 Gibibyte. It has been specified by the European Broadcasting Union....
 is a multichannel file format based on RIFF specification, developed by the European Broadcasting Union
European Broadcasting Union

The European Broadcasting Union is a confederation of 75 broadcasting organisations from 56 countries, and 43 associate broadcasters from a further 25....
. It is BWF-compatible and allows file sizes to exceed 4 gigabyte
Gigabyte

Gigabyte is an SI prefix-multiple of the unit byte for Computer data storage. Since the giga- prefix means 109, gigabyte means 1,000,000,000 bytes ....
s

Use of the INFO chunk

The official Microsoft documentation for Windows 3.1 states that the INFO chunk should be placed at the beginning of the file. This allows fast access to the file's descriptive metadata
Metadata

Metadata is "data about other data", of any sort in any media. An item of metadata may describe an individual datum, or content item, or a collection of data including multiple content items and hierarchical levels, for example a database schema....
, and lets file system software and multimedia file management applications quickly scan the top of each file and extract author information, icon thumbnails, preview audio, formatting information, and so on.

When Windows XP
Windows XP

Windows XP is a line of operating systems produced by Microsoft for use on personal computers, including home and business desktops, laptop, and media centers....
's file management software encounters an RIFF-format file, it will automatically attempt to read this INFO chunk, and the user can specify some common RIFF fields (e.g. Author, Copyright date) that can be used to supplement the more usual file property fields such as file size and creation date.

Controversies

In line with their policy of using .RIFF for all Windows "multimedia" files, Microsoft introduced a new variant on the existing MIDI file format used for storing song information to be played on electronic musical instruments. Microsoft's "new" MIDI file format consisted of a standard MIDI file enclosed in a RIFF "wrapper", and had the extension .RMI
Musical Instrument Digital Interface

MIDI is an industry-standard communications protocol defined in 1982 that enables electronic musical instruments such as keyboard controllers, computers, and other electronic equipment to communicate, control, and synchronize with each other....
. This caused some upset at the time, since it took a while for existing music software to be updated to use the new format, and not everyone accepted that the creation of a new file format was justified in this case.

When dealing with large video files, expanding or contracting the INFO chunk can result in the entire file (which might be several gigabytes in size) having to be rewritten, which is a disk-intensive process. The correct workaround to this problem is to "pad out" the INFO chunk using dummy data (using a "dummy chunk" or "pad chunk") when a large file is created, so that later editing can expand or contract the "dummy" field to keep the total size of the INFO chunk constant: an intelligently-written piece of software can then overwrite just the INFO chunk when header data is changed, and does not have to modify or move the main body of the file.

However, since this method requires a certain amount of additional work on the part of the software programmer, and since the full RIFF specifications were scattered amongst Microsoft's documentation, some programmers believed that it was legal (and simpler) to place the INFO chunk at the end of a RIFF file, and some faulty documentation began to circulate recommending this practice. Misplacing the INFO chunk in this way means that the data will not be read by all media programs, and also means that there is a risk that the entire INFO chunk may be accidentally discarded or overwritten by software that strictly adheres to the official file specification.

These "pseudo-RIFF" files seem to be more common on the Macintosh, perhaps because Mac programmers are less likely to have access to first-hand Windows documentation. In general, the writers of Mac media software and cross-platform programs tend to be more aware of this potential problem than people producing Windows-only applications: for instance, circa 2004, Apple's QuickTime
QuickTime

QuickTime is a multimedia framework developed by Apple Inc., capable of handling various formats of digital video, media clips, sound, text, animation, music, and QuickTime VRs....
 media software running under Windows seemed to correctly identify and read misplaced INFO chunks, but Sony
Sony

is a multinational corporation list of conglomerates corporation headquartered in Minato, Tokyo, Japan, and one of the world's largest media conglomerates with revenue exceeding US$99.1 billion ....
's Windows-only media software (and Windows itself) would not. This can be a major problem when processing media files in bulk, since a "harmless" batch-processing operation such as format-conversion or normalization can result in an entire library's-worth of files having their metadata irretrievably destroyed before a user notices. This issue is most relevant to libraries originating on the Macintosh platform, or from broadcast facilities using software written to EBU specifications.

Although CorelDRAW
CorelDRAW

CorelDRAW is a vector graphics editor developed and marketed by Corel of Ottawa, Canada. It is also the name of Corel's Graphics Suite. Its latest version, named X4 , was released in January 2008....
10 nominally uses a RIFF file structure, it places the INFO chunk at the end, so that any embedded preview bitmap will not be displayed under Windows' file manager by default. An add-on utility supplied with the program fixes this problem.

See also

  • IFF
    Interchange File Format

    Interchange File Format , is a generic file format originally introduced by the Electronic Arts company in 1985 in order to ease transfer of data between software produced by different companies....
  • AIFF
    AIFF

    Audio Interchange File Format is an audio file format standard used for storing sound data for personal computers and other electronic audio devices....
  • FourCC
    FourCC

    A FourCC is a sequence of four bytes used to uniquely identify data formats. The concept originated in the OSType scheme used in the Mac OS and was adopted for the Amiga/Electronic Arts Interchange File Format and derivatives....
  • BWF Broadcast Wave Format


Some common RIFF file types


  • WAV
    WAV

    WAV , short for Waveform audio format, is a Microsoft and International Business Machines audio file format standard for storing an audio bitstream on personal computer....
     (Windows audio)
  • AVI
    Audio Video Interleave

    Audio Video Interleave, known by its acronym AVI, is a multimedia container format introduced by Microsoft in November 1992 as part of its Video for Windows technology....
     (Windows audiovisual)
  • RMI
    Musical Instrument Digital Interface

    MIDI is an industry-standard communications protocol defined in 1982 that enables electronic musical instruments such as keyboard controllers, computers, and other electronic equipment to communicate, control, and synchronize with each other....
     (Windows "RIFF MIDIfile")
  • CDR
    CorelDRAW

    CorelDRAW is a vector graphics editor developed and marketed by Corel of Ottawa, Canada. It is also the name of Corel's Graphics Suite. Its latest version, named X4 , was released in January 2008....
     (CorelDRAW vector graphics file)
  • ANI
    ANI (file format)

    The ANI file format is a graphics file format used for animation cursor on the Microsoft Windows operating system.The format is based on the Microsoft RIFF file format, which is used as a container format for storing the individual frames of the animation....
     (Animated Windows cursors)


External links