arduino-audio-tools
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MDFEchoCancellation< T, SampleType > Class Template Reference

Acoustic echo canceller using MDF algorithm. More...

#include <MDFEchoCancellation.h>

Inheritance diagram for MDFEchoCancellation< T, SampleType >:
AudioStream BaseStream AudioInfoSupport AudioInfoSource Stream Print

Public Types

using Mem = Word32
 
using Num = typename SampleType::float_t
 
using State = EchoState< T, SampleType >
 
using Word16 = typename SampleType::word16_t
 
using Word32 = typename SampleType::word32_t
 

Public Member Functions

 MDFEchoCancellation (int filterLength, AudioFFTBase &fftDriver, Allocator &alloc=DefaultAllocator)
 
 MDFEchoCancellation (int filterLength, int nbMic, int nbSpeakers, AudioFFTBase &fftDriver, Allocator &alloc=DefaultAllocator)
 
 ~MDFEchoCancellation ()
 
virtual void addNotifyAudioChange (AudioInfoSupport &bi)
 Adds target to be notified about audio changes.
 
virtual AudioInfo audioInfo () override
 provides the actual input AudioInfo
 
virtual AudioInfo audioInfoOut ()
 
virtual int available () override
 
virtual int availableForWrite () override
 
virtual bool begin ()
 
void cancel (const T *rec, const T *play, T *out)
 
void capture (const T *rec, T *out)
 
virtual void clearNotifyAudioChange ()
 Deletes all change notify subscriptions.
 
int control (int request, void *ptr)
 
virtual void end ()
 
virtual void flush () override
 
int getFilterLength ()
 
int getFrameSize ()
 
void getImpulseResponse (echo_int32_t *response)
 
int getImpulseResponseSize ()
 
int getMicChannels ()
 
int getSamplingRate ()
 
int getSpeakerChannels ()
 
StategetState ()
 
bool isNotifyActive ()
 Checks if the automatic AudioInfo update is active.
 
virtual operator bool ()
 
void playback (const T *play)
 
virtual size_t readBytes (uint8_t *data, size_t len) override
 
virtual size_t readSilence (uint8_t *buffer, size_t length)
 Source to generate silence: just sets the buffer to 0.
 
virtual bool removeNotifyAudioChange (AudioInfoSupport &bi)
 Removes a target in order not to be notified about audio changes.
 
void reset ()
 
virtual void setAudioInfo (AudioInfo newInfo) override
 Defines the input AudioInfo.
 
void setFFTDriver (AudioFFTBase &fftDriver)
 
void setFilterLength (int len)
 
void setMicChannels (int num)
 
void setNotifyActive (bool flag)
 Deactivate/Reactivate automatic AudioInfo updates: (default is active)
 
void setSamplingRate (int rate)
 
void setSpeakerChannels (int num)
 
void setWriteBufferSize (int size)
 
virtual size_t write (const uint8_t *data, size_t len) override
 
virtual size_t write (uint8_t ch) override
 
virtual void writeSilence (size_t len)
 Writes len bytes of silence (=0).
 

Protected Member Functions

template<typename A >
AechoAlloc (size_t count)
 Allocate a zero-initialized array of type A using the configured Allocator (see AudioTools/CoreAudio/AudioBasic/Collections/Allocator.h)
 
void echoCancellationImpl (State *st, const T *in, const T *far_end, T *out)
 Core echo cancellation implementation.
 
void echoFatal (const char *str)
 
template<typename A >
void echoFree (A *ptr, size_t count)
 Deallocate an array previously returned by echoAlloc()
 
StateechoStateInitMc (int frame_size, int filter_length, int nb_mic, int nb_speakers)
 Initialize multi-channel echo canceller state.
 
void echoWarning (const char *str)
 
void ensureInitialized ()
 Ensure echo canceller is initialized (lazy initialization)
 
void filterDcNotch16 (const T *in, Word16 radius, Word16 *out, int len, Mem *mem, int stride)
 Apply DC notch filter to remove DC offset.
 
void mdfAdjustProp (const Word32 *W, int N, int M, int P, Word16 *prop)
 Adjust proportional adaptation weights.
 
Word32 mdfInnerProd (const Word16 *x, const Word16 *y, int len)
 Compute inner product of two vectors.
 
virtual int not_supported (int out, const char *msg="")
 
void notifyAudioChange (AudioInfo info)
 
void powerSpectrum (const Word16 *X, Word32 *ps, int N)
 Compute power spectrum from FFT output.
 
void powerSpectrumAccum (const Word16 *X, Word32 *ps, int N)
 Accumulate power spectrum from FFT output.
 
void refillReadBuffer ()
 Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read()
 
T saturateToSample (Num x) const
 Rounds and saturates a de-emphasized output sample to T's representable range. Replaces the original fixed int16_t-only WORD2INT macro. Uses NumberConverter::minValueT<T>()/maxValueT<T>() (symmetric +-maxValue(bits) – a harmless 1-LSB narrower on the negative side than T's native asymmetric two's-complement minimum, e.g. -32767 vs -32768 for int16_t).
 
void spectralMulAccum (const Word16 *X, const Word32 *Y, Word16 *acc, int N, int M)
 Accumulate spectral multiplication across multiple frames.
 
float spxCos (float x)
 Compute cosine function.
 
float spxExp (float x)
 Compute exponential function.
 
echo_int16_t spxIlog2 (echo_uint32_t x)
 
template<typename A >
A spxSqrt (A x)
 
void weightedSpectralMulConj (const Num *w, const Num p, const Word16 *X, const Word16 *Y, Word32 *prod, int N)
 Compute weighted spectral multiplication with conjugate.
 

Protected Attributes

int _timeout = 10
 
Allocatorallocator
 
AudioFFTBasefft_driver
 
int filter_length
 
AudioInfo info
 
bool initialized = false
 
bool is_notify_active = true
 
int nb_mic
 
int nb_speakers
 
Vector< AudioInfoSupport * > notify_vector
 
Statestate = nullptr
 
RingBuffer< uint8_ttmp_in {0}
 
RingBuffer< uint8_ttmp_out {0}
 
int write_buffer_size = MAX_SINGLE_CHARS
 

Detailed Description

template<typename T = int16_t, typename SampleType = MDFFloat>
class audio_tools::MDFEchoCancellation< T, SampleType >

Acoustic echo canceller using MDF algorithm.

High-performance echo cancellation implementation based on the Multi-Delay block Frequency adaptive filter (MDF) algorithm. Supports both single and multi-channel configurations with customizable memory allocation. This is the underlying algorithm used by MDFEchoCancellationStream – use this class directly (via capture()/playback(), or the self-contained cancel()) if you don't want the Stream-based wrapper.

The echo canceller operates by:

Features:

Note
This implementation requires an external FFT driver implementing the AudioFFTBase interface from AudioFFT.h (only AudioRealFFT has been verified – see the Weaknesses note below).

Example usage:

cfg.length = 256; // frame size in samples
cfg.sample_rate = 16000;
fftDriver.begin(cfg);
int filterLength = 1024; // in samples
MDFEchoCancellation<> echo(filterLength, fftDriver); // MDFFloat, uses DefaultAllocator
echo.playback(speakerFrame); // frame_size samples
echo.capture(micFrame, outputFrame); // frame_size samples each
AudioFFTConfig defaultConfig(RxTxMode mode=TX_MODE)
Provides the default configuration.
Definition AudioFFT.h:209
AudioFFT using RealFFT.
Definition AudioRealFFT.h:125
Acoustic echo canceller using MDF algorithm.
Definition MDFEchoCancellation.h:297
A * echoAlloc(size_t count)
Allocate a zero-initialized array of type A using the configured Allocator (see AudioTools/CoreAudio/...
Definition MDFEchoCancellation.h:623
@ RXTX_MODE
Definition AudioTypes.h:26
int length
Definition AudioFFT.h:55

Strengths (see MDFEchoCancellationStream for the fuller writeup):

Template Parameters
TThe PCM sample type used by capture()/playback() (e.g. int16_t, int32_t). Defaults to int16_t. Must match the sample type of the audio actually flowing through the canceller – see saturateToSample().
SampleTypeMDFFloat (default) or MDFFixedPoint.

Member Typedef Documentation

◆ Mem

template<typename T = int16_t, typename SampleType = MDFFloat>
using Mem = Word32

◆ Num

template<typename T = int16_t, typename SampleType = MDFFloat>
using Num = typename SampleType::float_t

◆ State

template<typename T = int16_t, typename SampleType = MDFFloat>
using State = EchoState<T, SampleType>

◆ Word16

template<typename T = int16_t, typename SampleType = MDFFloat>
using Word16 = typename SampleType::word16_t

◆ Word32

template<typename T = int16_t, typename SampleType = MDFFloat>
using Word32 = typename SampleType::word32_t

Constructor & Destructor Documentation

◆ MDFEchoCancellation() [1/2]

template<typename T = int16_t, typename SampleType = MDFFloat>
MDFEchoCancellation ( int  filterLength,
AudioFFTBase fftDriver,
Allocator alloc = DefaultAllocator 
)
inline

Initialize echo canceller with single channel (mono)

Parameters
filterLengthLength of echo cancellation filter in samples
fftDriverFFT driver instance from AudioFFT
allocAllocator used for the echo-state buffers (optional, defaults to the shared DefaultAllocator)

◆ MDFEchoCancellation() [2/2]

template<typename T = int16_t, typename SampleType = MDFFloat>
MDFEchoCancellation ( int  filterLength,
int  nbMic,
int  nbSpeakers,
AudioFFTBase fftDriver,
Allocator alloc = DefaultAllocator 
)
inline

Initialize echo canceller with multiple channels

Parameters
filterLengthLength of echo cancellation filter in samples
nbMicNumber of microphone channels
nbSpeakersNumber of speaker channels
fftDriverFFT driver instance from AudioFFT
allocAllocator used for the echo-state buffers (optional, defaults to the shared DefaultAllocator)

◆ ~MDFEchoCancellation()

template<typename T = int16_t, typename SampleType = MDFFloat>
~MDFEchoCancellation ( )
inline

Destructor

Member Function Documentation

◆ addNotifyAudioChange()

virtual void addNotifyAudioChange ( AudioInfoSupport bi)
inlinevirtualinherited

◆ audioInfo()

virtual AudioInfo audioInfo ( )
inlineoverridevirtualinherited

◆ audioInfoOut()

virtual AudioInfo audioInfoOut ( )
inlinevirtualinherited

◆ available()

virtual int available ( )
inlineoverridevirtualinherited

◆ availableForWrite()

virtual int availableForWrite ( )
inlineoverridevirtualinherited

◆ begin()

virtual bool begin ( )
inlinevirtualinherited

◆ cancel()

template<typename T = int16_t, typename SampleType = MDFFloat>
void cancel ( const T rec,
const T play,
T out 
)
inline

Perform echo cancellation

Parameters
recRecorded signal (with echo)
playPlayback signal (reference)
outOutput signal (echo removed)

◆ capture()

template<typename T = int16_t, typename SampleType = MDFFloat>
void capture ( const T rec,
T out 
)
inline

Process captured audio with buffered playback

Parameters
recRecorded signal
outOutput signal (echo removed)

◆ clearNotifyAudioChange()

virtual void clearNotifyAudioChange ( )
inlinevirtualinherited

Deletes all change notify subscriptions.

Reimplemented in RTSPClient< TcpClient, UdpSocket >.

◆ control()

template<typename T = int16_t, typename SampleType = MDFFloat>
int control ( int  request,
void ptr 
)
inline

Control/query echo canceller parameters

Parameters
requestRequest type (ECHO_GET_FRAME_SIZE, etc.)
ptrPointer to parameter value
Returns
0 on success, -1 on error

◆ echoAlloc()

template<typename T = int16_t, typename SampleType = MDFFloat>
template<typename A >
A * echoAlloc ( size_t  count)
inlineprotected

Allocate a zero-initialized array of type A using the configured Allocator (see AudioTools/CoreAudio/AudioBasic/Collections/Allocator.h)

Template Parameters
AType of objects to allocate
Parameters
countNumber of objects to allocate
Returns
Pointer to allocated and zero-initialized memory

◆ echoCancellationImpl()

template<typename T = int16_t, typename SampleType = MDFFloat>
void echoCancellationImpl ( State st,
const T in,
const T far_end,
T out 
)
inlineprotected

Core echo cancellation implementation.

Implements the complete MDF echo cancellation algorithm including:

  • Pre-processing (DC notch filter, pre-emphasis)
  • FFT transformation of input signals
  • Adaptive filter update in frequency domain
  • Echo prediction and subtraction
  • Two-path filter switching for double-talk handling
  • Post-processing (de-emphasis)
Parameters
stEcho state structure containing all internal state
inInput signal from microphones (interleaved if multi-channel)
far_endReference signal from speakers (interleaved if multi-channel)
outOutput signal with echo removed (interleaved if multi-channel)

◆ echoFatal()

template<typename T = int16_t, typename SampleType = MDFFloat>
void echoFatal ( const char str)
inlineprotected

◆ echoFree()

template<typename T = int16_t, typename SampleType = MDFFloat>
template<typename A >
void echoFree ( A ptr,
size_t  count 
)
inlineprotected

Deallocate an array previously returned by echoAlloc()

Template Parameters
AType of objects to deallocate
Parameters
ptrPointer to memory to deallocate
countNumber of objects originally allocated (must match the echoAlloc() call that produced ptr)

◆ echoStateInitMc()

template<typename T = int16_t, typename SampleType = MDFFloat>
State * echoStateInitMc ( int  frame_size,
int  filter_length,
int  nb_mic,
int  nb_speakers 
)
inlineprotected

Initialize multi-channel echo canceller state.

Parameters
frame_sizeNumber of samples per frame
filter_lengthTotal filter length in samples
nb_micNumber of microphone channels
nb_speakersNumber of speaker channels
Returns
Pointer to initialized echo state, or nullptr on failure

◆ echoWarning()

template<typename T = int16_t, typename SampleType = MDFFloat>
void echoWarning ( const char str)
inlineprotected

◆ end()

virtual void end ( )
inlinevirtualinherited

◆ ensureInitialized()

template<typename T = int16_t, typename SampleType = MDFFloat>
void ensureInitialized ( )
inlineprotected

Ensure echo canceller is initialized (lazy initialization)

◆ filterDcNotch16()

template<typename T = int16_t, typename SampleType = MDFFloat>
void filterDcNotch16 ( const T in,
Word16  radius,
Word16 out,
int  len,
Mem mem,
int  stride 
)
inlineprotected

Apply DC notch filter to remove DC offset.

Parameters
inInput signal
radiusFilter radius parameter
outOutput filtered signal
lenLength of signal
memFilter memory state (2 values)
strideStride for accessing input array

◆ flush()

virtual void flush ( )
inlineoverridevirtualinherited

◆ getFilterLength()

template<typename T = int16_t, typename SampleType = MDFFloat>
int getFilterLength ( )
inline

Get filter length

◆ getFrameSize()

template<typename T = int16_t, typename SampleType = MDFFloat>
int getFrameSize ( )
inline

Get frame size

◆ getImpulseResponse()

template<typename T = int16_t, typename SampleType = MDFFloat>
void getImpulseResponse ( echo_int32_t response)
inline

Get impulse response

Parameters
responseBuffer to store impulse response (must be pre-allocated)

◆ getImpulseResponseSize()

template<typename T = int16_t, typename SampleType = MDFFloat>
int getImpulseResponseSize ( )
inline

Get impulse response size

◆ getMicChannels()

template<typename T = int16_t, typename SampleType = MDFFloat>
int getMicChannels ( )
inline

Get number of microphone channels

◆ getSamplingRate()

template<typename T = int16_t, typename SampleType = MDFFloat>
int getSamplingRate ( )
inline

Get sampling rate

◆ getSpeakerChannels()

template<typename T = int16_t, typename SampleType = MDFFloat>
int getSpeakerChannels ( )
inline

Get number of speaker channels

◆ getState()

template<typename T = int16_t, typename SampleType = MDFFloat>
State * getState ( )
inline

Get underlying state (for advanced usage)

◆ isNotifyActive()

bool isNotifyActive ( )
inlineinherited

Checks if the automatic AudioInfo update is active.

◆ mdfAdjustProp()

template<typename T = int16_t, typename SampleType = MDFFloat>
void mdfAdjustProp ( const Word32 W,
int  N,
int  M,
int  P,
Word16 prop 
)
inlineprotected

Adjust proportional adaptation weights.

Parameters
WFilter weights in frequency domain
NFFT size
MNumber of filter blocks
PNumber of channels
propOutput proportional weights (normalized)

◆ mdfInnerProd()

template<typename T = int16_t, typename SampleType = MDFFloat>
Word32 mdfInnerProd ( const Word16 x,
const Word16 y,
int  len 
)
inlineprotected

Compute inner product of two vectors.

Parameters
xFirst input vector
ySecond input vector
lenLength of vectors
Returns
Sum of element-wise products

◆ not_supported()

virtual int not_supported ( int  out,
const char *  msg = "" 
)
inlineprotectedvirtualinherited

◆ notifyAudioChange()

void notifyAudioChange ( AudioInfo  info)
inlineprotectedinherited

◆ operator bool()

virtual operator bool ( )
inlinevirtualinherited

◆ playback()

template<typename T = int16_t, typename SampleType = MDFFloat>
void playback ( const T play)
inline

Buffer playback signal for later processing

Parameters
playPlayback signal to buffer

◆ powerSpectrum()

template<typename T = int16_t, typename SampleType = MDFFloat>
void powerSpectrum ( const Word16 X,
Word32 ps,
int  N 
)
inlineprotected

Compute power spectrum from FFT output.

Parameters
XFFT output in packed format
psOutput power spectrum
NFFT size

◆ powerSpectrumAccum()

template<typename T = int16_t, typename SampleType = MDFFloat>
void powerSpectrumAccum ( const Word16 X,
Word32 ps,
int  N 
)
inlineprotected

Accumulate power spectrum from FFT output.

Parameters
XFFT output in packed format
psAccumulated power spectrum (updated in place)
NFFT size

◆ readBytes()

virtual size_t readBytes ( uint8_t *  data,
size_t  len 
)
inlineoverridevirtualinherited

Implements BaseStream.

Reimplemented in LMSEchoCancellationStream< T >, MDFEchoCancellationStream< T, SampleType >, USBAudioDeviceBase, MozziStream, PureDataStream, AudioLoRa, URLStreamBufferedT< T >, URLStreamBufferedT< ICYStream >, AudioStreamWrapper, EncodedAudioStream, FaustStream< DSP >, AudioKitStream, AudioMP34DT05, I2SCodecStream, MiniAudioStream, PortAudioStream, TfLiteAudioStream, A2DPStream, AdaptiveResamplingStream, HLSStreamT< URLStream >, ICYStreamT< T >, URLStream, BufferedTaskStream, URLStreamESP32, NRF24Stream, SPIAudioSlave, VBANStream, AnalogAudioStream, AudioEffectStreamT< T >, AudioEffectStream, Equalizer3Bands, Equalizer3BandsPerChannel, I2SStream, ReformatBaseStream, TimedStream, MemoryStream, RingBufferStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, BufferedStream, ConverterStream< T >, MeasuringStream, ProgressStream, Throttle, InputMixer< T, SumT >, InputMerge< T >, CallbackStream, FilteredStream< T, TF >, FilteredStream< int16_t, int16_t >, VolumeMeter, AudioInputMonitor, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, FadeStream, FrequencyDetectorAutoCorrelation, FrequencyDetectorZeroCrossing, GoertzelStream, Pipeline, QualityAnalysisStream, VolumeStream, AudioFFTBase, AudioBLEClient, AudioBLEClient, AudioBLEServer, AudioBLEServer, EqualizerNBands< SampleT, AccT, NUM_TAPS, NUM_BANDS >, WM8960Stream, AnalogDriverESP32V1::IO16Bit, and AnalogDriverESP32V2::IO16Bit.

◆ readSilence()

virtual size_t readSilence ( uint8_t *  buffer,
size_t  length 
)
inlinevirtualinherited

Source to generate silence: just sets the buffer to 0.

◆ refillReadBuffer()

void refillReadBuffer ( )
inlineprotectedinherited

Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read()

◆ removeNotifyAudioChange()

virtual bool removeNotifyAudioChange ( AudioInfoSupport bi)
inlinevirtualinherited

Removes a target in order not to be notified about audio changes.

Reimplemented in RTSPClient< TcpClient, UdpSocket >.

◆ reset()

template<typename T = int16_t, typename SampleType = MDFFloat>
void reset ( )
inline

Reset echo canceller state

◆ saturateToSample()

template<typename T = int16_t, typename SampleType = MDFFloat>
T saturateToSample ( Num  x) const
inlineprotected

Rounds and saturates a de-emphasized output sample to T's representable range. Replaces the original fixed int16_t-only WORD2INT macro. Uses NumberConverter::minValueT<T>()/maxValueT<T>() (symmetric +-maxValue(bits) – a harmless 1-LSB narrower on the negative side than T's native asymmetric two's-complement minimum, e.g. -32767 vs -32768 for int16_t).

◆ setAudioInfo()

virtual void setAudioInfo ( AudioInfo  info)
inlineoverridevirtualinherited

◆ setFFTDriver()

template<typename T = int16_t, typename SampleType = MDFFloat>
void setFFTDriver ( AudioFFTBase fftDriver)
inline

Set FFT driver (must be called before first use)

Parameters
fftDriverReference to FFT driver instance

◆ setFilterLength()

template<typename T = int16_t, typename SampleType = MDFFloat>
void setFilterLength ( int  len)
inline

Set filter length (must be called before first use)

Parameters
lenLength of echo cancellation filter in samples

◆ setMicChannels()

template<typename T = int16_t, typename SampleType = MDFFloat>
void setMicChannels ( int  num)
inline

Set number of microphone channels (must be called before first use)

Parameters
numNumber of microphone channels

◆ setNotifyActive()

void setNotifyActive ( bool  flag)
inlineinherited

Deactivate/Reactivate automatic AudioInfo updates: (default is active)

◆ setSamplingRate()

template<typename T = int16_t, typename SampleType = MDFFloat>
void setSamplingRate ( int  rate)
inline

Set sampling rate

Parameters
rateSampling rate in Hz

◆ setSpeakerChannels()

template<typename T = int16_t, typename SampleType = MDFFloat>
void setSpeakerChannels ( int  num)
inline

Set number of speaker channels (must be called before first use)

Parameters
numNumber of speaker channels

◆ setWriteBufferSize()

void setWriteBufferSize ( int  size)
inlineinherited

◆ spectralMulAccum()

template<typename T = int16_t, typename SampleType = MDFFloat>
void spectralMulAccum ( const Word16 X,
const Word32 Y,
Word16 acc,
int  N,
int  M 
)
inlineprotected

Accumulate spectral multiplication across multiple frames.

Parameters
XInput spectrum (M frames)
YFilter weights in frequency domain
accOutput accumulated result
NFFT size
MNumber of frames to accumulate

◆ spxCos()

template<typename T = int16_t, typename SampleType = MDFFloat>
float spxCos ( float  x)
inlineprotected

Compute cosine function.

Parameters
xInput angle in radians
Returns
Cosine of x

◆ spxExp()

template<typename T = int16_t, typename SampleType = MDFFloat>
float spxExp ( float  x)
inlineprotected

Compute exponential function.

Parameters
xInput value
Returns
e raised to the power of x

◆ spxIlog2()

template<typename T = int16_t, typename SampleType = MDFFloat>
echo_int16_t spxIlog2 ( echo_uint32_t  x)
inlineprotected

◆ spxSqrt()

template<typename T = int16_t, typename SampleType = MDFFloat>
template<typename A >
A spxSqrt ( A  x)
inlineprotected

◆ weightedSpectralMulConj()

template<typename T = int16_t, typename SampleType = MDFFloat>
void weightedSpectralMulConj ( const Num w,
const Num  p,
const Word16 X,
const Word16 Y,
Word32 prod,
int  N 
)
inlineprotected

Compute weighted spectral multiplication with conjugate.

Parameters
wWeight array for each frequency bin
pGlobal scaling factor
XFirst input spectrum
YSecond input spectrum (conjugated)
prodOutput product
NFFT size

◆ write() [1/2]

virtual size_t write ( const uint8_t *  data,
size_t  len 
)
inlineoverridevirtualinherited

◆ write() [2/2]

virtual size_t write ( uint8_t  ch)
inlineoverridevirtualinherited

◆ writeSilence()

virtual void writeSilence ( size_t  len)
inlinevirtualinherited

Writes len bytes of silence (=0).

Member Data Documentation

◆ _timeout

int _timeout = 10
protectedinherited

◆ allocator

template<typename T = int16_t, typename SampleType = MDFFloat>
Allocator& allocator
protected

Allocator used for the echo-state buffers

◆ fft_driver

template<typename T = int16_t, typename SampleType = MDFFloat>
AudioFFTBase* fft_driver
protected

Pointer to FFT driver instance

◆ filter_length

template<typename T = int16_t, typename SampleType = MDFFloat>
int filter_length
protected

Length of echo cancellation filter

◆ info

AudioInfo info
protectedinherited

◆ initialized

template<typename T = int16_t, typename SampleType = MDFFloat>
bool initialized = false
protected

Lazy initialization flag

◆ is_notify_active

bool is_notify_active = true
protectedinherited

◆ nb_mic

template<typename T = int16_t, typename SampleType = MDFFloat>
int nb_mic
protected

Number of microphone channels

◆ nb_speakers

template<typename T = int16_t, typename SampleType = MDFFloat>
int nb_speakers
protected

Number of speaker channels

◆ notify_vector

Vector<AudioInfoSupport*> notify_vector
protectedinherited

◆ state

template<typename T = int16_t, typename SampleType = MDFFloat>
State* state = nullptr
protected

Pointer to internal echo canceller state

◆ tmp_in

RingBuffer<uint8_t> tmp_in {0}
protectedinherited

◆ tmp_out

RingBuffer<uint8_t> tmp_out {0}
protectedinherited

◆ write_buffer_size

int write_buffer_size = MAX_SINGLE_CHARS
protectedinherited

The documentation for this class was generated from the following file: