Fields marked with * may be missing. Based on the only known sample with no FourCC, it's assumed that all these fields are either present or missing. To determine if they are missing, check the header size (bytes 6-7).

The informative fields (title, author, copyright and comment) can have zero length.

RealAudio 2.0 file (.ra version 4)

This is second version of the RealAudio file format. It is distinguished from the above by the value in byte 5 (=0x04). This type of file must contain a valid FourCC to identify the audio codec.

There is a sample with chunk size = 0x10, in that case file version is a word. Note that the sample has chunk version = 0 like all other files.

File properties header (PROP)

This chunk contains some information about the general properties of a RealMedia file. Only one PROP chunk can be present in a file.

A PROP chunk has the following format

dword Chunk type ('PROP')
dword Chunk size (typically 0x32)
word Chunk version (always 0, for every known file)
dword Maximum bit rate
dword Average bit rate
dword Size of largest data packet
dword Average size of data packet
dword Number of data packets in the file
dword File duration in ms
dword Suggested number of ms to buffer before starting playback
dword Offset of the first INDX chunk form the start of the file
dword Offset of the first DATA chunk form the start of the file
word Number of streams in the file
word Flags (bitfield, see below)

Flags:

bit 0: file can be saved on disk

bit 1: PerfectPlay can be used (extra buffering)

bit 2: the file is a live broadcast

Media properties header (MDPR)

This chunk contains information about the properties of a RealMedia stream. This header defines the type of a stream and the codec used. All codec-related data is in the type specific part of this header.

Many fields share the same meanings as the ones in PROP chunk, but in this case they are specific for one stream.

Audio (audio/)

audio/x-pn-realaudio and audio/x-pn-multirate-realaudio

These mimetypes are used to specify streams with RealAudio codecs. There are 3 known versions of this datablock: ra3, ra4, ra5. ra3 is used only with the old 14_4 codec, ra4 and ra5 can be used with all the other codecs.

Data header (DATA)

This chunk contains a group of data packets. Packets from each stream are interleaved, except for multirate files.

A DATA chunk has the following format

dword Chunk type ('DATA')
dword Chunk size
word Chunk version (always 0, for every known file)
dword Number of data packets in this chunk
dword Offset of the next DATA chunk (form the start of the file)
byte[] Data packets

where packet group is "The packet group to which the packet belongs. If packet grouping is not used, set this field to 0 (zero)", asm rule is "The ASM rule assigned to this packet" and asm flags "Contains HX_ flags that dictate stream switching points".

Index header (INDX)

This chunk contains index entries. It comes after all the DATA chunks.
An index chunk contains data for a single stream, A file can have more than one INDX chunk.

A INDX chunk has the following format

dword Chunk type ('INDX')
dword Chunk size
word Chunk version (always 0, for every known file)
dword Number of entries in this chunk
word Stream number
dword Offset of the next INDX chunk (form the start of the file)
byte[] Index entries

Each index entry has this format

word Entry version (always 0, for every known file)
dword Timestamp (in ms)
dword Packet offset in file (form the start of the file)
dword Packet number

Codecs

Codecs in RealMedia are identified by the following four character codes: