Introduction
RIFX is the big-endian form of RIFF, and a RIFX WAVE file is a WAV file with every number stored most significant byte first. The 1991 RIFF specification from IBM and Microsoft defines it in one sentence: a RIFX file “is the same as a RIFF file, except that the first four bytes are ‘RIFX’ instead of ‘RIFF’, and integer byte ordering is represented in Motorola format”. The specification also says that no RIFX form types were defined at the time, and that registering a RIFF form does not register its RIFX counterpart.
It is rare. SciPy’s scipy.io.wavfile reads and writes it, and libsndfile
and FFmpeg read it; few other programs do. The chunks are the ones of an ordinary
RIFF WAVE file, but a reader that does not
swap the byte order gets every size and every sample wrong, so it is a separate format;
see all the WAV variations.
A file dropped on any page of this site opens in the explorer, which shows every chunk and field, read big-endian, and the waveform, which can be played.
Structure
A RIFX WAVE file is one outer chunk with the form type WAVE. Inside it
sit further chunks, each a four-character ID, a 32-bit big-endian size and the data,
padded to an even length. See RIFX
chunks.
Two chunks are required: the format
chunk fmt , which says how the audio is encoded, and the data chunk
data, which holds the samples, also big-endian; see
Sample data. Other chunks are
optional metadata. Chunk IDs
and other four-character codes are strings of bytes and read the same in either byte
order.
0RIFX chunk ID, file size minus 8, form type WAVE12 bytes
| Value | RIFF bytes | RIFX bytes |
|---|---|---|
| outer ID | 52 49 46 46 RIFF | 52 49 46 58 RIFX |
| format code 3, float (u16) | 03 00 | 00 03 |
| 44,100 Hz (u32) | 44 AC 00 00 | 00 00 AC 44 |
| 16-bit sample −2 (i16) | FE FF | FF FE |
| 8-bit sample 128 (u8) | 80 | 80 |
Telling it apart
The explorer’s parser for this format checks two things: bytes 0 to 3 are
RIFX and bytes 8 to 11 are WAVE. Nothing else turns a file
down. After the header, every problem it finds is reported on the chunk where it occurs,
and the rest of the file is still read.
A file that starts RIFF, RF64 or BW64 before
WAVE is one of the other WAV formats.
Browsers cannot play RIFX files, so the explorer decodes the samples itself, swapping the byte order, for PCM, float, A-law, µ-law and the two ADPCM codecs.
Who writes it
RIFX WAVE files are met mostly in software tests. The only ones examined for this site
are SciPy’s test files test-44100Hz-be-1ch-4bytes.wav,
test-8000Hz-be-3ch-5S-24bit.wav and
test-44100Hz-2ch-32bit-float-be.wav. SciPy writes RIFX when asked for
big-endian output; libsndfile and FFmpeg read it.
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
- FFmpeg – command-line tool that reads RIFX WAVE files and converts them to other formats (Windows, macOS, Linux)
Developers
- libsndfile – library that reads RIFX WAVE files, along with the other WAV forms (C)
- scipy.io.wavfile – SciPy’s WAV module, which reads and writes RIFX (Python)
- python-soundfile – audio file reading and writing, built on libsndfile (Python)
Reference
- Multimedia Programming Interface and Data Specifications 1.0 – the 1991 IBM and Microsoft specification of RIFF, RIFX and WAVE, at McGill
- WAVE file format notes – McGill University’s notes, with the Microsoft specifications
- Multiple channel audio data and WAVE files – Microsoft’s description of WAVE_FORMAT_EXTENSIBLE
- RFC 2361 – the registered WAVE format codes, as listed in 1998
- EBU Tech 3285 – the Broadcast Wave Format and its bext chunk