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); }
protected override void PerformEchoCancellation(short[] recorded, short[] played, short[] outFrame) { SpeexEchoCanceller.speex_echo_cancellation(_speexEchoState, recorded, played, outFrame); }