AudioStreamDescriptor AudioStreamDescriptor AudioStreamDescriptor AudioStreamDescriptor Class

Definition

Defines an audio media stream.

public : sealed class AudioStreamDescriptor : IAudioStreamDescriptor, IAudioStreamDescriptor2, IMediaStreamDescriptor
public sealed class AudioStreamDescriptor : IAudioStreamDescriptor, IAudioStreamDescriptor2, IMediaStreamDescriptor
Public NotInheritable Class AudioStreamDescriptor Implements IAudioStreamDescriptor, IAudioStreamDescriptor2, IMediaStreamDescriptor
var audioStreamDescriptor = new audioStreamDescriptor(encodingProperties);
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

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

Constructors

AudioStreamDescriptor(AudioEncodingProperties) AudioStreamDescriptor(AudioEncodingProperties) AudioStreamDescriptor(AudioEncodingProperties) AudioStreamDescriptor(AudioEncodingProperties)

Creates an instance of AudioStreamDescriptor class using the specified AudioEncodingProperties.

public : AudioStreamDescriptor(AudioEncodingProperties encodingProperties)
public AudioStreamDescriptor(AudioEncodingProperties encodingProperties)
Public Sub New(encodingProperties As AudioEncodingProperties)
var audioStreamDescriptor = new audioStreamDescriptor(encodingProperties);
Parameters
encodingProperties
AudioEncodingProperties AudioEncodingProperties AudioEncodingProperties AudioEncodingProperties

The encoding properties for the audio stream.

Properties

EncodingProperties EncodingProperties EncodingProperties EncodingProperties

The encoding properties of the stream.

public : AudioEncodingProperties EncodingProperties { get; }
public AudioEncodingProperties EncodingProperties { get; }
Public ReadOnly Property EncodingProperties As AudioEncodingProperties
var audioEncodingProperties = audioStreamDescriptor.encodingProperties;

Remarks

The application can change the encoding properties of the audio stream descriptor at any time.

If the media pipeline cannot handle the new encoding properties, the MediaStreamSource will raise the Closed event which provides information regarding the error.

IsSelected IsSelected IsSelected IsSelected

Specifies whether the stream is currently in use by the MediaStreamSource.

public : Platform::Boolean IsSelected { get; }
public bool IsSelected { get; }
Public ReadOnly Property IsSelected As bool
var bool = audioStreamDescriptor.isSelected;
Value
Platform::Boolean bool bool bool

true if the stream is currently in use by the MediaStreamSource; otherwise, false.

Remarks

IsSelected is true if the stream represented by the stream descriptor is currently selected by the media pipeline. For example, if it is currently in use by the MediaStreamSource. Otherwise, the value is false.

The MediaStreamSource only raises the SampleRequested event for streams which are selected.

Label Label Label Label

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

public : Platform::String Label { get; set; }
public string Label { get; set; }
Public ReadWrite Property Label As string
var string = audioStreamDescriptor.label;
audioStreamDescriptor.label = string;
Value
Platform::String string string string

An app-defined label that identifies an audio stream

Additional features and requirements
Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Remarks

The label for each stream in a single MediaEncodingProfile must be unique. Calling SetAudioTracks to add a stream descriptor containing a duplicate label will result in an invalid argument error.

Language Language Language Language

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

public : Platform::String Language { get; set; }
public string Language { get; set; }
Public ReadWrite Property Language As string
var string = audioStreamDescriptor.language;
audioStreamDescriptor.language = string;
Value
Platform::String string string string

The RFC-1766 language code for the stream.

Remarks

The initial value is an empty string.

The language is specified using a RFC-1766 language code, for example, “en-US”.

For more info on RFC-1766 language tags, see the RFC-1766 specification.

LeadingEncoderPadding LeadingEncoderPadding LeadingEncoderPadding 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.

public : IReference<unsigned int> LeadingEncoderPadding { get; set; }
public Nullable<uint> LeadingEncoderPadding { get; set; }
Public ReadWrite Property LeadingEncoderPadding As Nullable<uint>
var nullable = audioStreamDescriptor.leadingEncoderPadding;
audioStreamDescriptor.leadingEncoderPadding = nullable;
Value
IReference<unsigned int> Nullable<uint> Nullable<uint> Nullable<uint>

The number of samples inserted at the beginning of the audio stream by the encoder as padding.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Name Name Name Name

Gets or sets the name of the stream.

public : Platform::String Name { get; set; }
public string Name { get; set; }
Public ReadWrite Property Name As string
var string = audioStreamDescriptor.name;
audioStreamDescriptor.name = string;
Value
Platform::String string string string

The name of the stream.

Remarks

The initial value is an empty string.

The name is a free-form human readable string that describes the stream, for example, “English soundtrack”.

TrailingEncoderPadding TrailingEncoderPadding TrailingEncoderPadding 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.

public : IReference<unsigned int> TrailingEncoderPadding { get; set; }
public Nullable<uint> TrailingEncoderPadding { get; set; }
Public ReadWrite Property TrailingEncoderPadding As Nullable<uint>
var nullable = audioStreamDescriptor.trailingEncoderPadding;
audioStreamDescriptor.trailingEncoderPadding = nullable;
Value
IReference<unsigned int> Nullable<uint> Nullable<uint> Nullable<uint>

The number of samples inserted at the end of the audio stream by the encoder as padding.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

See Also