我们可以使用C#代码控制麦克风回声电平吗

时间:2019-05-09 04:19:48

标签: c# echo microphone

我需要在使用C#或其他任何支持以编程方式控制麦克风回声电平的设备现场直播时,以编程方式控制麦克风回声的水平。

以前,我使用visioforge SDK进行视频编辑和均衡器控制,但找不到与Echo电平相关的任何东西。

1 个答案:

答案 0 :(得分:0)

使用C#进行回声消除的示例代码

using System;
using Ozeki.Media;

namespace Acoustic_Echo_Cancellation
{
    class Program
    {
        static Microphone microphone;
        static Speaker speaker;
        static MediaConnector connector;
        static AudioQualityEnhancer audioProcessor;

        static void Main(string[] args)
        {
            microphone = Microphone.GetDefaultDevice();
            speaker = Speaker.GetDefaultDevice();
            connector = new MediaConnector();
            audioProcessor = new AudioQualityEnhancer();

            audioProcessor.AcousticEchoCancellation = true; // acoustic echo cancellation is enabled
            audioProcessor.SetEchoSource(speaker);  // sets the speaker to be the source of the echo

            connector.Connect(microphone, audioProcessor);  // voice data is being sent through the enhancer
            connector.Connect(audioProcessor, speaker);

            audioProcessor.Start();
            microphone.Start();
            speaker.Start();

            Console.ReadLine();
        }
    }
}

访问:http://www.voip-sip-sdk.com/p_373-how-to-implement-voip-acoustic-echo-cancellation-voip.html以获取更多信息