AudioStreamDescriptor 类

定义

表示音频媒体流的说明。

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
继承
Object Platform::Object IInspectable AudioStreamDescriptor
属性
实现

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

注解

创建 MediaEncodingProfile 时,请调用 SetAudioTracks,传入一个或多个 AudioStreamDescriptor 对象,以提供有关要编码的音轨的信息。

有关在 UWP 应用中使用媒体流源的示例,请参阅 MediaStreamSource 示例

版本历史记录

Windows 版本 SDK 版本 增值
1607 14393 LeadingEncoderPadding
1607 14393 TrailingEncoderPadding
1709 16299 Label
1803 17134 复制

构造函数

AudioStreamDescriptor(AudioEncodingProperties)

使用指定的 AudioEncodingProperties 创建 AudioStreamDescriptor 类的实例。

属性

EncodingProperties

获取描述音频流的编码属性的 对象。 这些属性包括音频的采样率和声道计数。

IsSelected

获取一个值,该值指示 MediaStreamSource 当前是否正在使用流。

Label

获取或设置一个应用定义的标签,该标签标识包含多个流的 MediaEncodingProfile 中的音频流。

Language

获取或设置流的 RFC-1766 语言代码。

LeadingEncoderPadding

获取或设置编码器作为填充在音频流开头插入的样本数。 使用此属性可以显式设置系统用于实现音频流的无间隙播放的填充大小。

Name

获取或设置流的名称。

TrailingEncoderPadding

获取或设置编码器作为填充在音频流末尾插入的样本数。 使用此属性可以显式设置系统用于实现音频流的无间隙播放的填充大小。

方法

Copy()

创建 AudioStreamDescriptor 的副本。

适用于

另请参阅