File Formats
  • Audio
  • Video
  • Images
  • 3D & CAD
  • Documents
  • Data
  • Code
  • System
Audio
  • Uncompressed
  • Lossless
  • Lossy
  • MIDI & trackers
  • Music projects
  • Instruments & samples
  • Playlists
  1. Home
  2. Audio
  3. Uncompressed
  4. WAV
  5. Sample data
.WAV
  • Overview
  • RIFF chunks
  • Format chunk
  • Sample data
  • Metadata chunks
    • fact
    • LIST INFO
    • cue
    • smpl
    • bext
  • RF64

Sample data

The data chunk holds the audio. It has no header of its own: how to read it comes entirely from the format chunk.

Frames and interleaving

A frame is one sample for every channel at the same moment. Frames follow one another in time order, and inside a frame the channels are interleaved: left then right for stereo, or the order of the channel mask for more channels.

Three numbers follow from the format chunk:

  • bytes per frame is nBlockAlign, which is nChannels × wBitsPerSample / 8 for PCM and float
  • the number of frames is the data chunk’s size divided by nBlockAlign
  • the length in seconds is the number of frames divided by nSamplesPerSec

Sample c of frame f starts at the data start plus f × nBlockAlign plus c × wBitsPerSample / 8.

Sample encodings

The format code and bits per sample together decide how each sample is stored. All multi-byte values are little-endian.

BitsFormat codeStored asSilenceRange
81unsigned integer1280 to 255
161signed integer0−32,768 to 32,767
241 or 0xFFFEsigned integer, 3 bytes0−8,388,608 to 8,388,607
321 or 0xFFFEsigned integer0−2,147,483,648 to 2,147,483,647
323 or 0xFFFEIEEE 754 single0.0−1.0 to 1.0, louder values allowed
643 or 0xFFFEIEEE 754 double0.0−1.0 to 1.0, louder values allowed
86 or 7A-law or µ-law codecode for 0a 13 or 14-bit value, compressed

8-bit PCM is the one unsigned case: subtract 128 to get a signed value. Every larger integer size is signed two’s complement.

Bit depths in between

A sample always fills whole bytes. A 20-bit recording is stored in 24-bit slots, with wBitsPerSample set to 24. An extensible format chunk then sets wValidBitsPerSample to 20. The real bits sit at the top of each slot and the unused low bits are zero, so a reader that ignores the valid bit count still plays the audio at the right level.

A worked example

The four frames at the end of the complete file example: 16-bit stereo, so 4 bytes per frame.

0000002C  00 00 00 00 FF 7F 01 80 FF FF 01 00 00 01 00 FF
Four stereo frames, with each left sample marked.
FrameLeftRight
000 00 = 000 00 = 0
1FF 7F = 32,767, the loudest positive value01 80 = −32,767
2FF FF = −101 00 = 1
300 01 = 25600 FF = −256

Compressed formats

For ADPCM and other codecs, the data chunk is a run of blocks of nBlockAlign bytes, each decoding to a fixed number of frames given in the codec’s extra format data. The number of frames cannot be worked out from the size, so these files carry a fact chunk with the frame count.

Padding

When the data chunk’s size is odd, as with 8-bit mono or 24-bit mono audio with an odd number of frames, one zero pad byte follows the samples. It is not part of the audio and is not counted in the chunk size.

© 2026 fileformats.org About Contact Made by Lewpen