Content deleted Content added
No edit summary Tags: section blanking Mobile edit Mobile web edit |
ce for tone |
||
(47 intermediate revisions by 29 users not shown) | |||
Line 1:
{{Short description|Tagged file structure for multimedia resource files}}
{{
{{Infobox file format
| name = RIFF
Line 20 ⟶ 21:
| latest_release_version =
| latest_release_date = <!-- {{start date and age|YYYY|mm|dd|df=yes/no}} -->
|
| container_for =
| contained_by =
Line 26 ⟶ 27:
| extended_to = [[Audio Video Interleave|AVI]], [[ANI (animation file format)|ANI]], PAL, RDIB, RMIDI, RMMP, [[WAV]]
| standard = <!-- or: | standards = -->
|
| free = Yes<ref>{{cite tech report |publisher=Library of Congress |___location=Washington, D.C. |series=Sustainability of Digital Formats |type=Full draft |title=RIFF (Resource Interchange File Format) |date=16 September 2004 |url=https://www.loc.gov/preservation/digital/formats/fdd/fdd000025.shtml |access-date=13 December 2021}}</ref>
| url =
}}
The Microsoft implementation is mostly known through the container formats
== History ==
RIFF was introduced in 1991 by [[Microsoft]] and [[International Business Machines|IBM]] and used as the default format for [[Windows 3.1x|Windows 3.1]] multimedia files. It is based on [[Interchange File Format]] introduced by [[Electronic Arts]] in 1985 on the [[Amiga]]. IFF uses the [[Endianness|big-endian]] convention of the Amiga's [[Motorola 68000]] CPU, but in RIFF multi-[[byte]] integers are stored in the [[Endianness|little-endian]] order of the [[x86]] processors used in [[IBM PC compatible]]s. A RIFX format, which is big-endian, was also introduced.
In 2010 Google introduced the [[WebP]] picture format, which uses RIFF as a container.<ref>{{Cite web |url=http://code.google.com/speed/webp/docs/riff_container.html |title=RIFF Container |work=[[Google Code]] |access-date=1 October 2010 }}</ref>
== Explanation ==
Line 38 ⟶ 45:
All chunks have the following format:
* 4 bytes: an [[ASCII]] identifier for this chunk (examples are "fmt " and "data"; note the space in "fmt ").
* 4 bytes: an unsigned, little-endian 32-[[bit]] 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.
Line 47 ⟶ 54:
* 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 "
More information about the RIFF format can be found in the [[Interchange File Format]] article.
[[RF64]] is a multichannel file format based on RIFF specification, developed by the [[European Broadcasting Union]]. It is [[Broadcast Wave Format|BWF]]-compatible and allows file sizes to exceed 4 [[gigabyte]]s. It does so by providing a "ds64" chunk with a 64-bit (8-byte) size.
== Use of the INFO chunk ==
Line 58 ⟶ 65:
== Compatibility issues ==
=== Initial difficulties with MIDI files ===
In line with their policy of using .RIFF for all Windows 3.1 "multimedia" files, Microsoft introduced a new variant on the existing [[MIDI|MIDI file]] format used for storing song information to be played on electronic musical instruments. Microsoft's
The MIDI Manufacturers Association have since embraced the RIFF-based MIDI file format, and used it as the basis of an "extended midifile" that also includes instrument data in "[[DLS format|DLS]]" format, embedded within the same .RMI file.
Line 73 ⟶ 80:
== RIFF info tags ==
RIFF information tags are found in WAV audio and AVI video files
{| class="wikitable"
Line 95 ⟶ 102:
=== Converting DTIM time to normal time ===
The field consists of two values (v[0] and v[1]) separated with a space (0x20). Sample code:
<
// time in seconds - "concatenate" date & time elements with a decimal point delimiter
TimeInSeconds = (v[0] * (2^32) + v[1]) * 10^(-7);
Line 101 ⟶ 108:
// shift basis from Jan 1, 1601 to Unix epoch Jan 1, 1970 (369 years & leap days)
UnixTimeStamp = TimeInSeconds - 134774 * 24 * 3600;
</syntaxhighlight>
== Some common RIFF file types ==
* [[WAV]] (Windows audio)
* [[Audio Video Interleave|AVI]] (Windows audiovisual)
* [[Musical Instrument Digital Interface#
* [[CorelDRAW|CDR]] (CorelDRAW vector graphics file)
* [[ANI (file format)|ANI]] (Animated Windows cursors)
Line 115 ⟶ 122:
== See also ==
* [[Interchange File Format|IFF]] (the [[big-endian]] format from which RIFF derives)
* [[Audio Interchange File Format|AIFF]]
* [[Broadcast Wave Format|BWF]] Broadcast Wave Format
* [[Type–length–value|TLV]] (the generic format that RIFF is an example of)
* [[FourCC]] (the chunk identification approach used by many TLV formats, including IFF, as verbose [[Magic number (programming)#Format indicator|Magic number]])
== References ==
|