Windows Media Audio Encoder

The Windows Media Audio encoder encodes audio streams. The encoder supports three categories of encoded output: Windows Media Audio Standard, Windows Media Audio Professional, and Windows Media Audio Lossless.

Class Identifier

The class identifier (CLSID) for the Windows Media Audio Encoder is represented by the constant CLSID_CWMAEncMediaObject. You can create an instance of the audio encoder by calling CoCreateInstance.

Input Formats

The following table shows the audio format tags that represent the input categories supported by the Windows Media Audio encoder. For information about how to set the input and output types for the encoder, see Configuring Audio Encoding.

Format tag constant Format tag value Audio format
WAVE_FORMAT_PCM 0x0001 PCM format
WAVE_FORMAT_IEEE_FLOAT 0x0003 IEEE floating point
WAVE_FORMAT_EXTENSIBLE 0xFFFE PCM/IEEE format in WAVEFORMATEXTENSIBLE structure

 

Output Formats

The following table shows the audio format tags that represent the output categories supported by the Windows Media Audio encoder.

Format tag constant Format tag value Audio format
WAVE_FORMAT_WMAUDIO2 0x0161 Windows Media Audio Standard
WAVE_FORMAT_WMAUDIO3 0x0162 Windows Media Audio Professional
WAVE_FORMAT_WMAUDIO_LOSSLESS 0x0163 Windows Media Audio Lossless

 

Interfaces

An audio endoder object exposes the IMediaObject interface so that the object can be used as a DirectX Media Object (DMO), and it exposes the IMFTransform interface so that the object can be used as a Media Foundation Transform (MFT).

A Windows Media Audio encoder behaves as a DMO or an MFT depending on which interfaces you obtain and which version of Windows is running. The following table shows the conditions under which an audio encoder behaves as a DMO or an MFT.

Operating system Encoder behavior
Windows XP A Windows Media Audio encoder always behaves as a DMO.
Windows Vista By default, a Windows Media Audio encoder behaves as a DMO. If you obtain an IMFTransform interface or an IPropertyStore interface on an audio encoder, it behaves as an MFT.
Windows 7 By default, a Windows Media Audio encoder behaves as a DMO. If you obtain an IMFTransform interface on an audio encoder, it behaves as an MFT.

 

Encoder Properties

The Windows Media Audio encoder supports the following properties.

Property Description
MFPKEY_AVGCONSTRAINED Specifies whether the encoder uses average-controllable VBR encoding.
Windows Vista and later.
Standard, Professional, Lossless.
Read/write.
MFPKEY_BMAX Specifies the buffer window, in milliseconds, of a constrained variable-bit-rate (VBR) stream at its peak bit rate.
Windows XP and later.
Standard, Professional.
Read/write.
MFPKEY_CHECKDATACONSISTENCY2P Specifies whether whether the encoder should check for data consistency across passes when performing two-pass VBR encoding.
Windows Vista and later.
Standard, Professional, Lossless.
Read-only.
MFPKEY_CONSTRAINDECLATENCY Specifies whether the encoder is constrained by a maximum decoder latency requirement.
Windows Vista and later.
Standard, Professional, Lossless.
Read/write.
MFPKEY_CONSTRAINENCCOMPLEXITY Specifies whether the complexity of the encoding algorithm is constrained.
Windows Vista and later.
Standard, Professional, Lossless.
Read/write.
MFPKEY_CONSTRAINENCLATENCY Specifies whether the encoder is constrained by a maximum latency requirement.
Windows Vista and later.
Standard, Professional, Lossless.
Read/write.
MFPKEY_CONSTRAIN_ENUMERATED_VBRQUALITY Specifies whether modes enumerated by the encoder are limited to those that meet a quality requirement.
Windows Vista and later.
Standard, Professional, Lossless.
Read/write.
MFPKEY_DECODERCOMPLEXITYPROFILE Specifies the complexity profile of the encoded content.
Windows XP and later.
Standard, Professional, Lossless.
Read-only.
MFPKEY_DESIRED_VBRQUALITY Specifies the desired quality level for VBR encoding.
Windows Vista and later.
Standard, Professional, Lossless.
Write-only.
MFPKEY_DYN_ALLOW_NOISESUB Specifies whether the encoder uses noise substitution.
Windows Vista and later.
Standard, Professional, Lossless.
Read/write.
MFPKEY_DYN_ALLOW_PCMRANGELIMITING Specifies whether the encoder uses PCM range limiting.
Windows Vista and later.
Standard, Professional, Lossless.
Read/write.
MFPKEY_DYN_BANDTRUNC_BWCEIL Specifies the maximum coded bandwidth allowed by band truncation in the encoder.
Windows Vista and later.
Standard, Professional, Lossless.
Read/write.
MFPKEY_DYN_BANDTRUNC_BWFLOOR Specifies the minimum coded bandwidth allowed by band truncation in the encoder.
Windows Vista and later.
Standard, Professional, Lossless.
Read/write.
MFPKEY_DYN_BANDTRUNC_QCEIL Specifies the quality at which minimum coded bandwidth is allowed.
Windows Vista and later.
Standard, Professional, Lossless.
Read/write.
MFPKEY_DYN_BANDTRUNC_QFLOOR Specifies the quality at which maximum coded bandwidth is allowed.
Windows Vista and later.
Standard, Professional, Lossless.
Read/write.
MFPKEY_DYN_BANDTRUNCATION Specifies whether the encoder performs band truncation.
Windows Vista and later.
Standard, Professional, Lossless.
Read/write.
MFPKEY_DYN_SIMPLEMASK Specifies whether the encoder uses the style of mask computation performed by version 7 of the Windows Media Audio encoder.
Windows Vista and later.
Standard, Professional, Lossless.
Read/write.
MFPKEY_DYN_STEREO_PREPROC Specifies whether the encoder performs stereo image processing.
Windows Vista and later.
Standard, Professional, Lossless.
Read/write.
MFPKEY_DYN_VBR_BAVG Specifies the buffer window, in milliseconds, for an encoder that is configured to use average-controllable VBR encoding.
Windows Vista and later.
Standard, Professional, Lossless.
Read/write.
MFPKEY_DYN_VBR_RAVG Specifies the average bit rate, in bits per second, for an encoder that is configured to use average-controllable VBR encoding.
Windows Vista and later.
Standard, Professional, Lossless.
Read/write.
MFPKEY_ENCCOMPLEXITY Specifies the complexity of the encoding algorithm.
Windows Vista and later.
Standard, Professional, Lossless.
Read/write.
MFPKEY_ENDOFPASS Specifies the end of an encoding pass.
Windows XP and later.
Standard, Professional.
Write-only.
MFPKEY_ENHANCED_WMA Specifies whether the core encoder uses the "Plus" feature.
Windows Vista and later.
Professional.
Read/write.
MFPKEY_MAXDECLATENCYMS Specifies the maximum latency for the decoder, in milliseconds.
Windows Vista and later.
Standard, Professional, Lossless.
Write-only.
MFPKEY_MAXENCLATENCYMS Specifies the maximum latency for the encoder, in milliseconds.
Windows Vista and later.
Standard, Professional, Lossless.
Write-only.
MFPKEY_MOST_RECENTLY_ENUMERATED_VBRQUALITY Specifies the VBR quality level of the most recently enumerated output type.
Windows Vista and later.
Standard, Professional, Lossless.
Read-only.
MFPKEY_PASSESRECOMMENDED Specifies the maximum number of passes supported by the encoder.
Windows XP and later.
Standard, Professional, Lossless.
Read-only.
MFPKEY_PASSESUSED Specifies the number of passes that the encoder will use to encode the content.
Windows XP and later.
Standard, Professional, Lossless.
Read/write.
MFPKEY_PEAKCONSTRAINED Specifies whether the encoder is constrained by a peak bit rate.
Windows Vista and later.
Standard, Professional.
Read/write.
MFPKEY_PREFERRED_FRAMESIZE Specifies the preferred number of samples per frame.
Windows Vista and later.
Professional.
Read/write.
MFPKEY_REQUESTING_A_FRAMESIZE Specifies whether the encoder should use a preferred frame size.
Windows Vista and later.
Professional.
Read/write.
MFPKEY_RMAX Specifies the peak bit rate, in bits per second, used for constrained 2-pass variable-bit-rate (VBR) encoding.
Windows XP and later.
Standard, Professional.
Read/write.
MFPKEY_STAT_BAVG Specifies the average buffer window, in milliseconds, of an encoded stream.
Windows XP and later.
Standard, Professional, Lossless.
Read-only.
MFPKEY_STAT_BMAX Specifies the maximum buffer window, in milliseconds, of an encoded stream.
Windows XP and later.
Standard, Professional, Lossless.
Read-only.
MFPKEY_STAT_RAVG Specifies the average bit rate, in bits per second, of an encoded stream.
Windows XP and later.
Standard, Professional, Lossless.
Read-only.
MFPKEY_STAT_RMAX Specifies the maximum bit rate, in bits per second, of an encoded stream.
Windows XP and later.
Standard, Professional, Lossless.
Read-only.
MFPKEY_VBRENABLED Specifies whether the encoder uses VBR encoding.
Windows XP and later.
Standard, Professional, Lossless.
Read/write.
MFPKEY_WMA_ELEMENTARY_STREAM This property is currently not used by the Windows Media Audio codec.
MFPKEY_WMADRC_AVGREF Specifies the average volume level of audio content.
Windows XP and later.
Standard, Professional, Lossless.
Read-only.
MFPKEY_WMADRC_PEAKREF Specifies the highest volume level occurring in audio content.
Windows XP and later.
Standard, Professional, Lossless.
Read-only.
MFPKEY_WMAENC_AVGBYTESPERSEC Specifies the average bytes per second for VBR encoded audio.
Windows XP and later.
Standard, Professional, Lossless.
Read-only.
MFPKEY_WMAENC_BUFFERLESSCBR Specifies whether the encoder should produce 1 WMA packet per frame.
Windows Vista and later.
Standard, Professional, Lossless.
Read/write.
MFPKEY_WMAENC_GENERATE_DRC_PARAMS Specifies whether the encoder should generate dynamic range control parameters.
Windows Vista and later.
Standard, Professional, Lossless.
Read/write.
MFPKEY_WMAENC_ORIGWAVEFORMAT Specifies the WAVEFORMATEX structure describing the input audio content.
Windows XP and later.
Standard, Professional.
Read/write.
MFPKEY_WMAENC_RTSPDIF Specifies whether the encoder should enable real-time S/PDIF encoding .
Windows Vista and later.
Professional.
Read/write.

 

Requirements

Client
Windows XP, Windows Vista or Windows 7
Header
Wmcodecdsp.h
DLL
Wmadmoe.dll

See also

Codec Objects

Codec Implementation