AudioCaptureEffectsManager 类

定义

表示音频捕获效果管理器,可用于发现设备上特定媒体类别和音频处理模式的音频处理链。

public ref class AudioCaptureEffectsManager sealed
/// [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.MTA)]
class AudioCaptureEffectsManager final
[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.MTA)]
public sealed class AudioCaptureEffectsManager
Public NotInheritable Class AudioCaptureEffectsManager
继承
Object Platform::Object IInspectable AudioCaptureEffectsManager
属性

Windows 要求

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

示例

以下示例演示 CaptureEffectsManager.GetAudioCaptureEffects 以检测指定捕获设备上是否存在 DeepNoiseSuppression 效果。

private bool IsDeepNoiseSuppressionSupported()
{
    var captureEffectsManager = Windows.Media.Effects.AudioEffectsManager.CreateAudioCaptureEffectsManager(
        MediaDevice.GetDefaultAudioCaptureId(AudioDeviceRole.Default),
        Windows.Media.Capture.MediaCategory.Speech,
        Windows.Media.AudioProcessing.Default);

    // Check for the presence of DeepNoiseSuppression
    IReadOnlyList<AudioEffect> effectslist = captureEffectsManager.GetAudioCaptureEffects();
    for (int i = 0; i < effectslist.Count; i++)
    {
        if (effectslist[i].AudioEffectType == Windows.Media.Effects.AudioEffectsType.DeepNoiseSuppression)
        {
            return true;
        }
    }

    return false;
}

注解

若要创建 AudioCaptureEffectsManager 的实例,请调用 AudioEffectsManager.CreateAudioCaptureEffectsManager。 或者,可以通过访问 属性从 AudioDeviceController 获取此类的 AudioCaptureEffectsManager 实例。

有关如何在呈现和捕获音频设备上查询和监视音频效果的示例,请参阅音频效果 发现示例

方法

GetAudioCaptureEffects()

获取设备上的音频效果列表。

事件

AudioCaptureEffectsChanged

在音频进程链更改时发生。

适用于

另请参阅