Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

AudioEncodingProperties class

Describes the format of an audio stream.

Syntax


public sealed class AudioEncodingProperties : IMediaEncodingProperties

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/write

Gets or sets the audio bit rate.

BitsPerSample

Read/write

Gets or sets the number of bits per audio sample.

ChannelCount

Read/write

Gets or sets the number of audio channels.

Properties

Read-only

Gets additional format properties for the audio stream.

SampleRate

Read/write

Gets or sets audio sampling rate.

Subtype

Read/write

Gets or sets the subtype of the format.

Type

Read-only

Gets 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 (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

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

Attributes

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

See also

Object
IMediaEncodingProperties

 

 

Show: