AudioCaptureEffectsManager.GetAudioCaptureEffects 方法

定义

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

public:
 virtual IVectorView<AudioEffect ^> ^ GetAudioCaptureEffects() = GetAudioCaptureEffects;
IVectorView<AudioEffect> GetAudioCaptureEffects();
public IReadOnlyList<AudioEffect> GetAudioCaptureEffects();
function getAudioCaptureEffects()
Public Function GetAudioCaptureEffects () As IReadOnlyList(Of AudioEffect)

返回

音频效果列表。

示例

以下示例演示 了 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;
}

适用于