.WAV
Waveform Audio File Format
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.
A WAV file can also hold compressed audio, such as ADPCM or µ-law, named by a format
code in its header. Sizes in a WAV file are 32-bit, which limits a file to 4 GB.
The Broadcast Wave Format adds a bext chunk with production details, and
RF64 lifts the size limit. Files use the extension .wav, and sometimes
.wave.
Software
- Audacity (Windows, macOS, Linux)
- VLC media player (Windows, macOS, Linux, mobile)
- Adobe Audition (Windows, macOS)
- REAPER (Windows, macOS, Linux)
- Pro Tools (Windows, macOS)
- Logic Pro (macOS)
- Ableton Live (Windows, macOS)
- ocenaudio (Windows, macOS, Linux)
- foobar2000 (Windows, macOS, mobile)
- FFmpeg (Windows, macOS, Linux)
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. Files over
4 GB use RF64.
0RIFF chunk ID, file size minus 8, form type WAVE12 bytes12fmt format code, channels, sample rate, byte rate, block align, bits per sample24 bytes36data chunk header, then the samples8 bytes + samples…LIST, cue , smpl, bext … optional chunksvaries
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 |