Skip to content

WAVE Format

Overview

Example of running xxd -l 44 -c 16 <SomeFile.wav>

         |   (1)   |   (2)   |   (3)   |   (4)   |
00000000: 5249 4646 32b0 1e04 5741 5645 666d 7420  RIFF2...WAVEfmt

         |   (5)   |(6) |(7) |   (8)   |   (9)   |
00000010: 1200 0000 0300 0600 80bb 0000 0094 1100  ................

         |(10)|(11)|
00000020: 1800 2000 0000 6661 6374 0400            .. ...fact..

The 11 binary blocks shown above are:

  1. The header that reads "RIFF" in ASCII.
  2. The size (in bytes, little endian) of the rest of the chunk following this number.
    • For typical WAV file, the RIFF chunk is basically the only chunk in the file. Hence this number is typically the file size less 8 bytes.
    • The size of 32b0 1e04 in little endian means it is of 0x041eb032 bytes.
  3. The format of the chunk.
    • For typical WAV file, this reads "WAVE" in ASCII.
  4. The ID of the first subchunk
    • For typical WAV file, the first subchunk is usually "fmt " (it's "fmt" with a trailing white space to make it 4 bytes in total length).
  5. The size (in bytes, little endian) of the rest of the subchunk following this number.
  6. The audio format (little endian) such as PCM or float
  7. The number of channels (little endian)
  8. Sampling Rate (number of samples per second per channel, little endian)
  9. Byte Rate (little endian)
  10. BlockAlign
  11. BitsPerSample

Reference