The format category of a WAVE file is specified by the value of the <formatTag> field of the “fmt” chunk. The representation of data in the “data” chunk, and the content of the <FormatSpecific> field of the “fmt” chunk, depend on the format category.
wFormatTag Value | Format Category |
WAVE_FORMAT_PCM (value 1) | Pulse Code Modulation (PCM) Format |
The following sections describe the different format categories.
The “data” chunk contains samples represented in pulse code modulation (PCM) format. For WAVE files in this category, the FormatSpecific field of the “fmt” chunk contains a <PCMFormatSpecific> structure, which contains a single field, <nBitsPerSample>. This field specifies the number of bits of data used to represent each sample of each channel. If there are multiple channels, the sample size is the same for each channel.
In a single-channel WAVE file, samples are stored consecutively. For stereo WAVE files, channel 0 represents the left channel, and channel 1 represents the right channel. The speaker position mapping for more than two channels is currently undefined. In multiple-channel WAVE files, samples are interleaved.
The following diagrams show the data packing for a 8-bit mono and stereo WAVE files:
The following diagrams show the data packing for 16-bit mono and stereo WAVE files: