Delen via


AudioStreamDescriptor Class

Definition

Represents a description an audio media stream.

public ref class AudioStreamDescriptor sealed
public ref class AudioStreamDescriptor sealed : IMediaStreamDescriptor2
/// [Windows.Foundation.Metadata.Activatable(Windows.Media.Core.IAudioStreamDescriptorFactory, 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 AudioStreamDescriptor 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(Windows.Media.Core.IAudioStreamDescriptorFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class AudioStreamDescriptor 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(Windows.Media.Core.IAudioStreamDescriptorFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class AudioStreamDescriptor final : IMediaStreamDescriptor2
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Media.Core.IAudioStreamDescriptorFactory), 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 AudioStreamDescriptor
[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(typeof(Windows.Media.Core.IAudioStreamDescriptorFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class AudioStreamDescriptor
[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(typeof(Windows.Media.Core.IAudioStreamDescriptorFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class AudioStreamDescriptor : IMediaStreamDescriptor2
function AudioStreamDescriptor(encodingProperties)
Public NotInheritable Class AudioStreamDescriptor
Public NotInheritable Class AudioStreamDescriptor
Implements IMediaStreamDescriptor2
Inheritance
Object Platform::Object IInspectable AudioStreamDescriptor
Attributes
Implements

Windows requirements

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

Remarks

When creating a MediaEncodingProfile, call SetAudioTracks, passing in one or more AudioStreamDescriptor objects to provide information about the audio tracks to be encoded.

See the MediaStreamSource Sample for an example of using Media Stream Source in a UWP app.

Version history

Windows version SDK version Value added
1607 14393 LeadingEncoderPadding
1607 14393 TrailingEncoderPadding
1709 16299 Label
1803 17134 Copy

Constructors

AudioStreamDescriptor(AudioEncodingProperties)

Creates an instance of AudioStreamDescriptor class using the specified AudioEncodingProperties.

Properties

EncodingProperties

Gets an object describing the encoding properties for the audio stream. These properties include the sample rate and channel count of the audio.

IsSelected

Gets a value indicating whether the stream is currently in use by a MediaStreamSource.

Label

Gets or sets an app-defined label that identifies an audio stream in a MediaEncodingProfile that contains multiple streams.

Language

Gets or sets the RFC-1766 language code for the stream.

LeadingEncoderPadding

Gets or sets the number of samples inserted at the beginning of the audio stream by the encoder as padding. Use this property to explicitly set the padding size the system will use to implement gapless playback for the audio stream.

Name

Gets or sets the name of the stream.

TrailingEncoderPadding

Gets or sets the number of samples inserted at the end of the audio stream by the encoder as padding. Use this property to explicitly set the padding size the system will use to implement gapless playback for the audio stream.

Methods

Copy()

Creates a copy of the AudioStreamDescriptor.

Applies to

See also