Last modified by Kashif Iqbal on 2019/12/13 13:28

WAV, known for WAVE (Waveform Audio File Format), is a subset of Microsoft's Resource Interchange File Format (RIFF) specification for storing digital audio files. The format doesn't apply any compression to the bitstream and stores the audio recordings with different sampling rates and bitrates. It has been and is one of the standard format for audio CDs. Wave files are larger in size as compared to new audio file formats such as MP3 which uses lossy compression to reduce the file size while maintaining the same audio quality. However, WAV files can be compressed using Audio Compression Manager (ACM) codecs. There are several APIs and applications available that can convert WAV files to other popular audio file formats.

WAV File Format

The WAVE file format, being a subset of Microsoft's RIFF specification, starts with a file header followed by a sequence of data chunks. A WAVE file has a single "WAVE" chunk which consists of two sub-chunks:

  • a "fmt" chunk - specifies the data format
  • a "data" chunk - contains the actual sample data

WAV File Header

The header of a WAV (RIFF) file is 44 bytes long and has the following format:

PositionsSample ValueDescription
1 - 4"RIFF"Marks the file as a riff file. Characters are each 1 byte long.
5 - 8File size (integer)Size of the overall file - 8 bytes, in bytes (32-bit integer). Typically, you'd fill this in after creation.
9 -12"WAVE"File Type Header. For our purposes, it always equals "WAVE".
13-16"fmt "Format chunk marker. Includes trailing null
17-2016Length of format data as listed above
21-221Type of format (1 is PCM) - 2 byte integer
23-242Number of Channels - 2 byte integer
25-2844100Sample Rate - 32 byte integer. Common values are 44100 (CD), 48000 (DAT). Sample Rate = Number of Samples per second, or Hertz.
29-32176400(Sample Rate * BitsPerSample * Channels) / 8.
33-344(BitsPerSample * Channels) / 8.1 - 8 bit mono2 - 8 bit stereo/16 bit mono4 - 16 bit stereo
35-3616Bits per sample
37-40"data""data" chunk header. Marks the beginning of the data section.
41-44File size (data)Size of the data section.
Sample values are given above for a 16-bit stereo source.


Created by Kashif Iqbal on 2019/09/10 02:57