ADPCMWAVEFORMAT Structure

The ADPCMWAVEFORMAT structure defines the format of ADPCM audio data.

Syntax

typedef struct adpcmwaveformat_tag {
    WAVEFORMATEX wfx;
    WORD wSamplesPerBlock;
    WORD wNumCoef;
    ADPCMCOEFSET aCoef[];
} ADPCMWAVEFORMAT;

Members

  • wfx
    Base WAVEFORMATEX structure that specifies the basic format. The wFormatTag member must be WAVE_FORMAT_ADPCM.
  • wSamplesPerBlock
    Size of an ADPCM block measured in samples, which must be between 32 and 512. See ADPCM Overview for more information.
  • wNumCoef
    Number of entries in aCoef.
  • aCoef
    Array of ADPCM compression coefficients.

Remarks

XAudio2 currently only supports "Microsoft ADPCM". This format always uses exactly 7 coefficients (wNumCoef is always 7), and they are defined as follows.

      wNumCoef = 7 
      aCoeff = { {256, 0}, {512, -256}, {0,0}, {192,64}, {240,0}, {460, -208}, {392,-232} } 
   

The wSamplesPerBlock can be computed using the following formula.

      wSamplesPerBlock = wfx.nBlockAlign * 2 / wfx.nChannels - 12 
   

The ADPCM Command-Line Encoder (AdpcmEncode) generates .WAV files using the Microsoft ADPCM format as specified here.

Requirements

Header: Declared in audiodefs.h.