The WAVEFORMATEXTENSIBLE structure defines the format of waveform-audio data for formats having more than two channels or higher sample resolutions than allowed by WAVEFORMATEX.
This structure is not part of the DirectSound API but is documented here for convenience.
typedef struct WAVEFORMATEXTENSIBLE { WAVEFORMATEX Format; WORD wValidBitsPerSample; WORD wSamplesPerBlock; WORD wReserved; DWORD dwChannelMask; DWORD SubFormat; } WAVEFORMATEXTENSIBLE;
WAVEFORMATEXTENSIBLE can describe any format that can be described by WAVEFORMATEX, but provides additional support for more than two channels, for greater precision in the number of bits per sample, and for new compression schemes.
WAVEFORMATEXTENSIBLE can safely be cast to WAVEFORMATEX, because it simply configures the extra bytes specified by WAVEFORMATEX.cbSize. DirectSound recognizes the WAVE_FORMAT_EXTENSIBLE format tag and correctly plays multiple-channel and compressed formats in hardware buffers, as long as these formats are supported by the driver.
The dwChannelMask member specifies which channels are present in the multichannel stream. The least significant bit corresponds with the front left speaker, the next least significant bit corresponds to the front right speaker, and so on. The bits, in order of significance, are defined in Ksmedia.h and Mmreg.h as follows.
Speaker position | Flag bit |
---|---|
SPEAKER_FRONT_LEFT | 0x1 |
SPEAKER_FRONT_RIGHT | 0x2 |
SPEAKER_FRONT_CENTER | 0x4 |
SPEAKER_LOW_FREQUENCY | 0x8 |
SPEAKER_BACK_LEFT | 0x10 |
SPEAKER_BACK_RIGHT | 0x20 |
SPEAKER_FRONT_LEFT_OF_CENTER | 0x40 |
SPEAKER_FRONT_RIGHT_OF_CENTER | 0x80 |
SPEAKER_BACK_CENTER | 0x100 |
SPEAKER_SIDE_LEFT | 0x200 |
SPEAKER_SIDE_RIGHT | 0x400 |
SPEAKER_TOP_CENTER | 0x800 |
SPEAKER_TOP_FRONT_LEFT | 0x1000 |
SPEAKER_TOP_FRONT_CENTER | 0x2000 |
SPEAKER_TOP_FRONT_RIGHT | 0x4000 |
SPEAKER_TOP_BACK_LEFT | 0x8000 |
SPEAKER_TOP_BACK_CENTER | 0x10000 |
SPEAKER_TOP_BACK_RIGHT | 0x20000 |
For more information on this structure, see the document Multiple Channel Audio Data and WAVE Files, available at www.microsoft.com.
Header: Declared in Mmreg.h, Ksproxy.h.