AudioEncodingProperties class

Applies to Windows and Windows Phone

Describes the format of an audio stream.

Syntax


public sealed class AudioEncodingProperties : IMediaEncodingProperties

Attributes

[DualApiPartition()]
[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]

Members

The AudioEncodingProperties class has these types of members:

Constructors

The AudioEncodingProperties class has these constructors.

ConstructorDescription
AudioEncodingProperties Creates a new instance of the AudioEncodingProperties class.

 

Methods

The AudioEncodingProperties class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
CreateAac Creates an instance of AudioEncodingProperties for Advanced Audio Coding (AAC) audio.
CreateAacAdts Creates an instance of AudioEncodingProperties for Advanced Audio Coding (AAC) audio in Audio Data Transport Stream (ADTS) format.
CreateMp3 Creates an instance of AudioEncodingProperties for MPEG Audio Layer-3 (MP3) audio.
CreatePcm Creates an instance of AudioEncodingProperties for Pulse Code Modulation (PCM) audio.
CreateWma Creates an instance of AudioEncodingProperties for Windows Media Audio (WMA).
GetFormatUserData Gets the media format user data.
SetFormatUserData Sets the media format user data.

 

Properties

The AudioEncodingProperties class has these properties.

PropertyAccess typeDescription

Bitrate

Read/writeGets or sets the audio bit rate.

BitsPerSample

Read/writeGets or sets the number of bits per audio sample.

ChannelCount

Read/writeGets or sets the number of audio channels.

Properties

Read-onlyGets additional format properties for the audio stream.

SampleRate

Read/writeGets or sets audio sampling rate.

Subtype

Read/writeGets or sets the subtype of the format.

Type

Read-onlyGets the format type.

 

Remarks

The encoding quality Auto is a special preset that fills in the proper settings based on the current camera settings. Settings that are manually modified are ignored. For example, if you create a preset profile using one the static create methods, such as CreateWav, and specify Auto as the encoding quality, any changes you make to the properties will be overwritten with values based on the current camera settings.

Note  On Windows Phone, setting AudioEncodingProperties has no effect. You can get the values, but you cannot change them.

Examples

The following example shows how to create an instance of this class.


function getFormat() {
    var encodingProperties = new Windows.Media.MediaProperties.AudioEncodingProperties();
    var audioSubType = encodingProperties.subtype;
    var audioType = encodingProperties.type;
    if (audioType === "Audio" && audioSubType === "MP3") {
        // The format is an MP3 audio stream.
    }
}


Requirements

Minimum supported client

Windows 8 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 [Windows Store apps, desktop apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Media.MediaProperties
Windows::Media::MediaProperties [C++]

Metadata

Windows.winmd

 

 

Show:
© 2014 Microsoft