Ejemplo n.º 1
0
        public SpeexEchoCancelFilter(int systemLatency, int filterLength, AudioFormat recordedAudioFormat, AudioFormat playedAudioFormat, IAudioFilter playedResampler = null, IAudioFilter recordedResampler = null) :
            base(systemLatency, filterLength, recordedAudioFormat, playedAudioFormat, playedResampler, recordedResampler)
        {
            _speexEchoState = SpeexEchoCanceller.speex_echo_state_init(recordedAudioFormat.SamplesPerFrame, filterLength, _logger);
            object sampleRate = recordedAudioFormat.SamplesPerSecond;

            SpeexEchoCanceller.speex_echo_ctl(_speexEchoState, EchoControlCommand.SetSamplingRate, ref sampleRate);
        }
Ejemplo n.º 2
0
 protected override void PerformEchoCancellation(short[] recorded, short[] played, short[] outFrame)
 {
     SpeexEchoCanceller.speex_echo_cancellation(_speexEchoState, recorded, played, outFrame);
 }