Setting an Output Type for a WMA Encoder

To create a valid output type for a Windows Media Audio (WMA) encoder, you must have the following information:

  • The audio subtype that repesents the encoded WMA format. See Audio Subtype GUIDs.

  • The configuration properties to set on the encoder.

    The configuration properties are documented in the Windows Media Audio and Video Codec and DSP APIs documentation. For more information, see "Audio Stream Properties" in Encoding Properties.

Windows Vista or Later

To get a valid output type for the encoder, perform the following steps.

  1. Use the MFTEnum or MFTEnumEx function to create an instance of the encoder.
  2. Query the encoder for the IPropertyStore interface.
  3. Use the IPropertyStore interface to configure the encoder.
  4. Retrieve the supported output types by calling IMFTransform::GetOutputAvailableType in a loop until the encoder returns MF_E_NO_MORE_TYPES and you choose the target media type. I
  5. Call IMFTransform::SetOutputType to set the compression media type on the encoder.

Windows 7

To get a valid output type for the encoder in Windows 7, Media Foundation provides the MFTranscodeGetAudioOutputAvailableTypes function. An application must pass required the audio subtype that repesents the encoded WMA and the encoding properties. The properties are required because the encoder changes the supported output types depending upon the mode set.

 

If the call succeeds, the application receives a list of IUnknown pointers of the supported output media types in an IMFCollection object. To set the output media type, find the one that matches your target type and call IMFTransform::SetOutputType to set the compression media type on the encoder.

Instantiating an Encoder MFT

Windows Media Encoders