Introduction
WAV is the standard audio file of Windows, defined by Microsoft and IBM in 1991 as part of the Resource Interchange File Format (RIFF). Most WAV files hold uncompressed PCM audio: a plain list of sample values, the same data a sound card plays. That makes WAV large but simple and exact, and it is the usual format for recording, editing and exchanging audio between programs.
This page is the ordinary WAV file, the one almost every .wav is. It
starts with RIFF, stores every number little-endian and gives every size in
32 bits, which limits a file to 4 GB. A WAV file can also hold compressed audio, such as
ADPCM or µ-law, named by a format code in its header.
A Broadcast Wave file (.bwf, or a .wav with a
bext chunk) is this format too. The European Broadcasting Union’s
specification, EBU Tech 3285, calls it a BWF file, but the bytes are an ordinary RIFF
WAVE file with one more chunk. The big-endian RIFX form and the 64-bit RF64 and BW64
forms are separate formats; see all the WAV
variations.
A file dropped on any page of this site opens in the explorer, which shows every chunk and field, the tags, cue points, loops and broadcast details, and the waveform, which can be played.
Structure
A WAV file is one RIFF chunk with the form type WAVE. Inside it sit
further chunks, each a four-character ID, a 32-bit little-endian size and the data,
padded to an even length. See RIFF
chunks.
Two chunks are required. The format
chunk fmt says how the audio is encoded: the format code, channel
count, sample rate and bits per sample. The data chunk data holds the
samples, laid out as the format chunk describes; see
Sample data. Other chunks are
optional and carry metadata:
a sample count, text tags, cue points, loop points and broadcast details.
0RIFF chunk ID, file size minus 8, form type WAVE12 bytes
The format chunk decides how everything after it is read. This table shows how the common choices change the file.
| Audio | Format code | fmt size | Block align | Sample values |
|---|---|---|---|---|
| 8-bit mono PCM | 1 | 16 | 1 | unsigned, 128 is silence |
| 16-bit stereo PCM | 1 | 16 | 4 | signed little-endian, left then right |
| 24-bit stereo PCM | 1 or 0xFFFE | 16 or 40 | 6 | signed, 3 bytes each |
| 32-bit float stereo | 3 | 16 or 18 | 8 | IEEE float, −1.0 to 1.0 |
| 5.1 surround, 24-bit | 0xFFFE | 40 | 18 | six channels in channel-mask order |
| IMA ADPCM | 0x11 | 20 | block size | 4-bit codes in blocks, with a fact chunk |
| Microsoft ADPCM | 2 | 50 | block size | 4-bit codes in blocks, with a fact chunk |
One format since 1991
Every change to WAV since the 1991 specification has added to it without changing what was there: new chunk IDs, which older readers skip; new format codes; and new fields at the end of a structure whose size says how much is present. So all of these are the same format:
- the 1991 RIFF specification from IBM and Microsoft, with the format, data, fact, cue, playlist, label and INFO chunks and integer PCM;
- Microsoft’s 1994 revision, which added
cbSizeto the format chunk (WAVEFORMATEX) and required afactchunk for every format that is not PCM; WAVE_FORMAT_EXTENSIBLE, with its channel mask and subformat GUID, for more than two channels and more than 16 bits;- every registered format code, from IEEE float, A-law and µ-law to the ADPCM codecs, GSM, MP3 and Ogg Vorbis in a WAV file;
- the Broadcast Wave Format’s
bextchunk, in versions 0 (1997), 1 (2001) and 2 (2011), and the other metadata chunks:iXML,axml,chna,smpl,inst,acid, ID3, XMP and more.
Telling it apart
The explorer’s parser for this format checks two things: bytes 0 to 3 are
RIFF and bytes 8 to 11 are WAVE. Nothing else turns a file
down. After the header, every problem it finds, such as a wrong outer size, a missing
pad byte or a chunk cut short, is reported on the chunk where it occurs, and the rest of
the file is still read.
A file that starts RIFX, RF64 or BW64 before
WAVE is one of the other WAV formats. A RIFF file with another form type,
such as AVI or WEBP, is not a WAV file at all.
Browsers play PCM and 32-bit float WAV files themselves. For a long file of that kind the explorer draws the waveform from peaks and plays the original file; otherwise it decodes the samples itself, including A-law, µ-law, IMA ADPCM and Microsoft ADPCM.
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
- Audacity – free audio editor that opens and saves WAV (Windows, macOS, Linux)
- VLC media player – free player for almost any audio or video file (Windows, macOS, Linux, mobile)
- Adobe Audition – Adobe’s audio editor for recording, editing and restoring sound (Windows, macOS)
- REAPER – low-cost digital audio workstation that records and renders WAV (Windows, macOS, Linux)
- Pro Tools – professional recording and mixing software that stores its audio as WAV (Windows, macOS)
- Logic Pro – Apple’s professional music production app, which records and exports WAV (macOS)
- Ableton Live – music production software that uses WAV for samples and exports (Windows, macOS)
- ocenaudio – free, simple audio editor (Windows, macOS, Linux)
- foobar2000 – free music player and converter (Windows, macOS, mobile)
- FFmpeg – command-line tool that converts WAV to and from other formats (Windows, macOS, Linux)
Developers
- libsndfile – library that reads and writes WAV and its 64-bit and big-endian forms (C)
- python-soundfile – audio file reading and writing, built on libsndfile (Python)
- wave – standard library module that reads and writes PCM WAV (Python)
- dr_wav – single-file library that decodes and encodes WAV (C)
Reference
- WAVE file format notes – McGill University’s notes, with the Microsoft specifications
- Multimedia Programming Interface and Data Specifications 1.0 – the 1991 IBM and Microsoft specification of RIFF and WAVE, at McGill
- 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