Introduction
RF64 is WAV for files larger than 4 GB. Every size in an ordinary WAV file is 32-bit,
so a file stops at 4 GB: a little over four hours of stereo audio at 48 kHz and 24 bits,
and much less for multichannel recordings. The European Broadcasting Union defined RF64
in EBU Tech 3306, “RF64: An Extended File Format for Audio”, keeping the WAV chunks and
adding one, ds64, that holds the sizes as 64-bit numbers.
Tech 3306 has had three versions. Version 1.0 (February 2007) was the first. Version 1.1
(July 2009) added an r64m marker chunk “in place of the cue chunk”, to
remove an ambiguous use of the cue chunk seen in some products. Version 2.0 (June 2018)
points to ITU-R BS.2088, whose BW64 format
continues the work; the EBU no longer develops Tech 3306. Files keep the extension
.wav, and are sometimes named .rf64.
A file dropped on any page of this site opens in the explorer, which takes apart the
chunks it knows, the 64-bit sizes from the ds64 chunk, the tags and
broadcast details, and plays the waveform of every codec it has a decoder for. The
format codes page lists those.
What makes it separate
An RF64 file has the same chunks as an ordinary WAV file, with the same layouts, but two things differ, and either one makes it a different format:
- the signature: the file starts
RF64instead ofRIFF; - the size rule: the outer size is set to
0xFFFFFFFF, and so is the size of the data chunk and of any other chunk too big for 32 bits. The real sizes are in theds64chunk, which comes first, straight afterWAVE.
A RIFF reader that does not know this rule takes 0xFFFFFFFF as a real size
and reads garbage, or gives up. Everything else, the
format chunk, the
samples and the
metadata chunks, is read as in
a WAV file. All numbers are little-endian.
Structure
0RF64 chunk ID, size0xFFFFFFFF, form type WAVE12 bytes12ds64 the real RIFF size, data size and frame count, and a table of other large sizes36 bytes + 12 per entry48fmt format code, channels, sample rate, byte rate, block align, bits per sample24 bytes or more…data chunk header with size0xFFFFFFFF, then the samples8 bytes + samples…bext, LIST, cue … optional chunksvaries
Recorders that cannot know in advance whether a recording will pass 4 GB often write an
ordinary WAV file with a 28-byte JUNK chunk where ds64 would go,
and turn the file into RF64 only if it grows too large; see
the JUNK chunk trick.
Telling it apart
The explorer’s parser for this format checks two things: bytes 0 to 3 are
RF64 and bytes 8 to 11 are WAVE. Nothing else turns a file
down. It reports, but does not reject, a file with no ds64 chunk, a
ds64 that is not the first chunk, an outer size that is not
0xFFFFFFFF, and a ds64 RIFF size that does not match the file.
Other readers are stricter: FFmpeg’s probe gives an RF64 file full marks only when
ds64 is at offset 12, and libbw64 refuses one whose first chunk is not
ds64.
A file that starts RIFF is an ordinary WAV file, even when it is laid out
for RF64 with a JUNK chunk first. One that starts BW64 is ITU-R
BW64, which shares this layout but is a separate format.
Browsers do not play RF64 files as a rule, so the explorer decodes the samples itself, up to its limit of about 16 million samples; for a longer file it shows the start.
Variants
- Waveform audio (RIFF) – the usual WAV file: little-endian chunks with 32-bit sizes
- Big-endian waveform audio (RIFX) – the same chunks with big-endian numbers
- EBU RF64 audio (RF64) – 64-bit sizes in a ds64 chunk, for files over 4 GB
- ITU-R BW64 audio (BW64) – RF64’s layout with Audio Definition Model metadata
Links
Software
Developers
- libsndfile – library that reads and writes RF64 as well as ordinary WAV (C)
- libbw64 – the EBU’s library that reads and writes RF64 and BW64 (C++)
- scipy.io.wavfile – SciPy’s WAV reader, which reads RIFF, RIFX and RF64 (Python)
- python-soundfile – audio file reading and writing, built on libsndfile (Python)
Reference
- EBU Tech 3306 – the EBU’s RF64 specification and its versions
- WAVE file format notes – McGill University’s notes, with the Microsoft specifications
- EBU Tech 3285 – the Broadcast Wave Format and its bext chunk