Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

WAVEFORMATEXTENSIBLE structure

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.

Syntax


typedef struct {
  WAVEFORMATEX Format;
  union {
    WORD wValidBitsPerSample;
    WORD wSamplesPerBlock;
    WORD wReserved;
  } Samples;
  DWORD        dwChannelMask;
  GUID         SubFormat;
} WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE;

Members

Format

WAVEFORMATEX structure that specifies the basic format. The wFormatTag member must be WAVE_FORMAT_EXTENSIBLE, defined in Mmreg.h. The cbSize member must be at least 22.

Samples

A union that contains the following members.

wValidBitsPerSample

Number of bits of precision in the signal. Usually equal to WAVEFORMATEX.wBitsPerSample. However, wBitsPerSample is the container size and must be a multiple of 8, whereas wValidBitsPerSample can be any value not exceeding the container size. For example, if the format uses 20-bit samples, wBitsPerSample must be at least 24, but wValidBitsPerSample is 20.

wSamplesPerBlock

Number of samples contained in one compressed block of audio data. This value is used in buffer estimation. This value is used with compressed formats that have a fixed number of samples within each block. This value can be set to zero if a variable number of samples is contained in each block of compressed audio data. In this case, buffer estimation and position information needs to be obtained in other ways.

wReserved

Reserved. Set to zero.

dwChannelMask

Bitmask specifying the assignment of channels in the stream to speaker positions. See Remarks.

SubFormat

A GUID that specifies the format of the audio data. The following GUIDs are defined in Ksmedia.h. Third parties can define additional GUIDs.

ValueMeaning
KSDATAFORMAT_SUBTYPE_ADPCM

Adaptive delta pulse code modulation (ADPCM)

KSDATAFORMAT_SUBTYPE_ALAW

A-law coding.

KSDATAFORMAT_SUBTYPE_DRM

DRM-encoded format for digital-audio content protected by Microsoft Digital Rights Management.

KSDATAFORMAT_SUBTYPE_IEC61937_DOLBY_DIGITAL_PLUS

Dolby Digital Plus formatted for HDMI output.

KSDATAFORMAT_SUBTYPE_IEC61937_DOLBY_DIGITAL

Dolby Digital Plus formatted for S/PDIF or HDMI output.

KSDATAFORMAT_SUBTYPE_IEEE_FLOAT

IEEE floating-point audio.

KSDATAFORMAT_SUBTYPE_MPEG

MPEG-1 audio payload.

KSDATAFORMAT_SUBTYPE_MULAW

μ-law coding

KSDATAFORMAT_SUBTYPE_PCM

PCM audio.

 

Remarks

The WAVEFORMATEXTENSIBLE structure can describe any format that can be described by the WAVEFORMATEX structure, but provides additional support for more than two channels, for greater precision in the number of bits per sample, and for new compression schemes.

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_LEFT0x1
SPEAKER_FRONT_RIGHT0x2
SPEAKER_FRONT_CENTER0x4
SPEAKER_LOW_FREQUENCY0x8
SPEAKER_BACK_LEFT0x10
SPEAKER_BACK_RIGHT0x20
SPEAKER_FRONT_LEFT_OF_CENTER0x40
SPEAKER_FRONT_RIGHT_OF_CENTER0x80
SPEAKER_BACK_CENTER0x100
SPEAKER_SIDE_LEFT0x200
SPEAKER_SIDE_RIGHT0x400
SPEAKER_TOP_CENTER0x800
SPEAKER_TOP_FRONT_LEFT0x1000
SPEAKER_TOP_FRONT_CENTER0x2000
SPEAKER_TOP_FRONT_RIGHT0x4000
SPEAKER_TOP_BACK_LEFT0x8000
SPEAKER_TOP_BACK_CENTER0x10000
SPEAKER_TOP_BACK_RIGHT0x20000

 

The following constants define some standard speaker configurations as bitwise ORs of the flags shown in the previous table.

Value Description Speakers
KSAUDIO_SPEAKER_MONOMonoFront center (C)
KSAUDIO_SPEAKER_STEREOStereoFront left (L), front right (R)
KSAUDIO_SPEAKER_QUADQuadraphonicL, R, back left (Lb), back right (Rb)
KSAUDIO_SPEAKER_SURROUNDSurroundL, R, front center (C), back center (Cb)
KSAUDIO_SPEAKER_5POINT15.1 channelL, R, C, Lb, Rb, low frequency (LFE)
KSAUDIO_SPEAKER_7POINT17.1 channelL, R, C, Lb, Rb, front left-of-center, front right-of-center, LFE
KSAUDIO_SPEAKER_5POINT1_SURROUND5.1 channel surroundL, R, C, side left (Ls), side right (Rs), LFE
KSAUDIO_SPEAKER_7POINT1_SURROUND7.1 channel surroundL, R, C, Lb, Rb, Ls, Rs, LFE

 

For more information on this structure, see the document Multiple Channel Audio Data and WAVE Files, available at www.microsoft.com.

Requirements

Header

MMReg.h;
Ksmedia.h

 

 

Community Additions

ADD
Show:
© 2015 Microsoft