Beispiel #1
0
            private void SetFilterPreprocessor(IntPtr preprocessor)
            {
                using (var handle = _handle.Lock())
                {
                    if (handle.Value == IntPtr.Zero)
                    {
                        throw Log.CreatePossibleBugException("Attempted  to access a null WebRtc Preprocessor encoder", "3BA66D46-A7A6-41E8-BE38-52AFE5212ACD");
                    }

                    Log.Debug("Exchanging preprocessor instance in playback filter...");

                    if (!AudioPluginDissonanceNative.Dissonance_PreprocessorExchangeInstance(IntPtr.Zero, handle.Value))
                    {
                        throw Log.CreatePossibleBugException("Cannot associate preprocessor with Playback filter - one already exists", "D5862DD2-B44E-4605-8D1C-29DD2C72A70C");
                    }

                    Log.Debug("...Exchanged preprocessor instance in playback filter");

                    var state = (AudioPluginDissonanceNative.FilterState)AudioPluginDissonanceNative.Dissonance_GetFilterState();
                    if (state == AudioPluginDissonanceNative.FilterState.FilterNotRunning)
                    {
                        Log.Debug("Associated preprocessor with playback filter - but filter is not running");
                    }

                    Bind(s => s.DenoiseAmount, "DenoiseAmount", v => NoiseSuppressionLevel             = (NoiseSuppressionLevels)v);
                    Bind(s => s.AecSuppressionAmount, "AecSuppressionAmount", v => AecSuppressionLevel = (AecSuppressionLevels)v);
                    Bind(s => s.AecmRoutingMode, "AecmRoutingMode", v => AecmSuppressionLevel          = (AecmRoutingMode)v);
                    Bind(s => s.VadSensitivity, "VadSensitivity", v => VadSensitivityLevel             = v);
                }
            }
Beispiel #2
0
 internal static AudioPluginDissonanceNative.FilterState GetAecFilterState()
 {
     return((AudioPluginDissonanceNative.FilterState)AudioPluginDissonanceNative.Dissonance_GetFilterState());
 }