WAVEFORMATEX Structure

The WAVEFORMATEX structure contains information for the audio stream(s) of an AVI RIFF file. This structure has the following members.

typedef struct waveformat_extended_tag {
    WORD  wFormatTag;      
    WORD  nChannels;       
    DWORD nSamplesPerSec;  
    DWORD nAvgBytesPerSec;
    WORD  nBlockAlign;     
    WORD  wBitsPerSample;  
    WORD  cbSize;          
} WAVEFORMATEX;
  • wFormatTag
    Defines the audio waveform type of the audio stream. A complete list of format tags can be found in the Mmreg.h header file included with Microsoft® Visual C++® and other Microsoft products.
  • nChannels
    Specifies the number of channels in the audio stream, 1 for mono, 2 for stereo.
  • nSamplesPerSec
    Specifies the frequency of the sample rate of the audio stream in samples/second (Hz). Examples are 11,025, 22,050, or 44,100.
  • nAvgBytesPerSec
    Specifies the average data rate. Playback software can estimate the buffer size by using this value.
  • nBlockAlign
    Specifies the block alignment of the data, in bytes. Playback software must process a multiple of nBlockAlign bytes of data at a time, so that the value of nBlockAlign can be used for buffer alignment.
  • wBitsPerSample
    Specifies the number of bits per sample per channel data. Each channel is assumed to have the same sample resolution. If this field is not needed, then you should set it to zero.
  • cbSize
    Specifies the size, in bytes, of the extra information in the format header, not including the size of the WAVEFORMATEX structure. For example, in the wave format corresponding to the wFormatTag WAVE_FORMAT_IMA_ADPCM, cbSize is calculated as sizeof(IMAADPCMWAVEFORMAT) - sizeof(WAVEFORMATEX), which yields two.

 Last updated on Tuesday, May 18, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.