Dela via


AudioEncodingProperties Class

Definition

Describes the encoding properties of an audio stream.

public ref class AudioEncodingProperties sealed
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class AudioEncodingProperties final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class AudioEncodingProperties final
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class AudioEncodingProperties
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class AudioEncodingProperties
function AudioEncodingProperties()
Public NotInheritable Class AudioEncodingProperties
Inheritance
Object Platform::Object IInspectable AudioEncodingProperties
Attributes
Implements

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

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 of 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

It is possible to create an AudioEncodingProperties that is not supported on a particular device. For example, you may successfully call CreateMp3, but if an mp3 encoder is not present on the device, attempting to encode audio with the properties returned from this method will fail. For a list of the codecs present by default for each device family, see Supported codecs..

For how-to guidance for setting the encoding properties for captured audio, see Basic photo, video, and audio capture with MediaCapture.

Version history

Windows version SDK version Value added
1703 15063 CreateAlac
1703 15063 CreateFlac
1703 15063 IsSpatial
1803 17134 Copy

Constructors

AudioEncodingProperties()

Creates a new instance of the AudioEncodingProperties class.

Properties

Bitrate

Gets or sets the audio bit rate.

BitsPerSample

Gets or sets the number of bits per audio sample.

ChannelCount

Gets or sets the number of audio channels.

IsSpatial

Gets a value indicating whether the audio is encoded with spatial audio information.

Properties

Gets additional format properties for the audio stream.

SampleRate

Gets or sets audio sampling rate.

Subtype

Gets or sets the subtype of the format.

Type

Gets the format type.

Methods

Copy()

Creates a copy of the AudioEncodingProperties object.

CreateAac(UInt32, UInt32, UInt32)

Creates an instance of AudioEncodingProperties for Advanced Audio Coding (AAC) audio.

CreateAacAdts(UInt32, UInt32, UInt32)

Creates an instance of AudioEncodingProperties for Advanced Audio Coding (AAC) audio in Audio Data Transport Stream (ADTS) format.

CreateAlac(UInt32, UInt32, UInt32)

Creates an instance of AudioEncodingProperties for Apple Lossless Audio Codec (ALAC) audio.

CreateFlac(UInt32, UInt32, UInt32)

Creates an instance of AudioEncodingProperties for Free Lossless Audio Codec (FLAC) audio.

CreateMp3(UInt32, UInt32, UInt32)

Creates an instance of AudioEncodingProperties for MPEG Audio Layer-3 (MP3) audio.

CreatePcm(UInt32, UInt32, UInt32)

Creates an instance of AudioEncodingProperties for Pulse Code Modulation (PCM) audio.

CreateWma(UInt32, UInt32, UInt32)

Creates an instance of AudioEncodingProperties for Windows Media Audio (WMA).

GetFormatUserData(Byte[])

Gets the media format user data.

SetFormatUserData(Byte[])

Sets the media format user data.

Applies to

See also