MP3 Audio Encoder

The Microsoft Media Foundation MP3 audio encoder is a Media Foundation Transform (MFT) that encodes MPEG-1 layer 3 (MP3) audio.

Class Identifier

The class identifier (CLSID) of the MP3 encoder is CLSID_MP3ACMCodecWrapper, defined in the header file wmcodecdsp.h.

Media Types

The MP3 encoder supports the following media types. The output type must be set before the input type.

Output Types

Set the following attributes on the output media type.

AttributeDescriptionRemarks
MF_MT_MAJOR_TYPE Major type.Must be MFMediaType_Audio.
MF_MT_SUBTYPE Audio subtype.Must be MFAudioFormat_MP3.
MF_MT_AUDIO_AVG_BYTES_PER_SECOND Bit rate of the encoded MP3 stream, in bytes per second.

The encoder supports all bit rates defined by the standard (32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, or 320 Kbps).

The default bit rates are 128 Kbps for mono and 320 Kbps for stereo.

Use this attribute to specify the encoded bit rate.

MF_MT_AUDIO_NUM_CHANNELS Number of channels. The following values are supported:
  • 1 (mono)
  • 2 (stereo)
MF_MT_AUDIO_SAMPLES_PER_SECOND Samples per second. The following values are supported:
  • 48000 (48 KHz)
  • 44100 (44.1 KHz)
  • 32000 (32 KHz)
MF_MT_USER_DATA Additional codec data.This attribute contains the 12 bytes of the MPEGLAYER3WAVEFORMAT structure that follow the wfx member of that structure.

 

Alternatively, you can fill in an MPEGLAYER3WAVEFORMAT structure and call MFInitMediaTypeFromWaveFormatEx to convert the structure to a Media Foundation media type.

Input Types

Set the following attributes on the input media type.

AttributeDescriptionRemarks
MF_MT_MAJOR_TYPE Major type.Must be MFMediaType_Audio.
MF_MT_SUBTYPE Subtype.Must be MFAudioFormat_PCM.
MF_MT_AUDIO_BITS_PER_SAMPLE Bits per sample. Must be 16.
MF_MT_AUDIO_SAMPLES_PER_SECOND Samples per second.Must match the output type.
MF_MT_AUDIO_NUM_CHANNELS Number of channels.Must match the output type.

 

The encoder supports only 16-bit integer PCM input. It does not support 32-bit floating point input.

Media Formats

The MPEG-1 and MPEG-2 standard defines 252 layer 3 audio formats. The MP3 encoder supports the standard with some exceptions, as well as some additional formats, as described below. Layer 3 is defined as:

Channelsmono or stereo
MPEG-1 sample rates in kHz44.1, 48, 32
MPEG-1 encoded bit rates in kbps32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320
MPEG-2 sample rates in kHz8, 11.025, 12, 16, 22.05, 24
MPEG-2 encoded bit rates in kbps8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 144, 160

 

The MP3 encoder also supports the following formats.

Sample RateBit RateChannel Number
800018000, 200002
1102518000, 200001 or 2
1200018000, 200001 or 2
1600018000, 200001
320001440001 or 2
441001440001 or 2
480001440001 or 2

 

The MP3 encoder does not support the following formats defined by the standard.

Sample RateBit RatesChannel Number
1200080000, 96000, 112000, 128000, 144000, 1600001 or 2
1102580000, 96000, 112000, 128000, 144000, 1600001 or 2
800080000, 96000, 112000, 128000, 144000, 1600001 or 2
80008000, 11025, 12000, 16000, 22050, 240002

 

Requirements

Minimum supported client

Windows 8 [desktop apps only]

Minimum supported server

Windows Server 2012 [desktop apps only]

 

 

Community Additions

ADD
Show:
© 2014 Microsoft