- Main Page
- Modules
- Namespaces
- Classes
- Files
- Directories
- Related Pages

# SpeexEchoState: Acoustic echo canceller

## Classes
class | SpeexEchoState
## Defines
#define | SPEEX_ECHO_GET_FRAME_SIZE 3
#define | SPEEX_ECHO_SET_SAMPLING_RATE 24
#define | SPEEX_ECHO_GET_SAMPLING_RATE 25
## Typedefs
typedef SpeexEchoState_ | SpeexEchoState
## Functions
SpeexEchoState * | speex_echo_state_init (int frame_size, int filter_length)
void | speex_echo_state_destroy (SpeexEchoState *st)
void | speex_echo_cancellation (SpeexEchoState *st, const spx_int16_t *rec, const spx_int16_t *play, spx_int16_t *out)
void | speex_echo_cancel (SpeexEchoState *st, const spx_int16_t *rec, const spx_int16_t *play, spx_int16_t *out, spx_int32_t *Yout)
void | speex_echo_capture (SpeexEchoState *st, const spx_int16_t *rec, spx_int16_t *out)
void | speex_echo_playback (SpeexEchoState *st, const spx_int16_t *play)
void | speex_echo_state_reset (SpeexEchoState *st)
int | speex_echo_ctl (SpeexEchoState *st, int request, void *ptr)

## Detailed Description

This is the acoustic echo canceller module.

## Define Documentation

#define SPEEX_ECHO_GET_FRAME_SIZE 3

Obtain frame size used by the AEC

#define SPEEX_ECHO_GET_SAMPLING_RATE 25

Get sampling rate

#define SPEEX_ECHO_SET_SAMPLING_RATE 24

Set sampling rate

## Typedef Documentation

typedef struct SpeexEchoState_ SpeexEchoState

Internal echo canceller state. Should never be accessed directly.

## Function Documentation

void speex_echo_cancel | ( | SpeexEchoState * | st,
|  | const spx_int16_t * | in,
|  | const spx_int16_t * | far_end,
|  | spx_int16_t * | out,
|  | spx_int32_t * | Yout |
| ) |  |  |

Performs echo cancellation on a frame (deprecated, last arg now ignored)

void speex_echo_cancellation | ( | SpeexEchoState * | st,
|  | const spx_int16_t * | in,
|  | const spx_int16_t * | far_end,
|  | spx_int16_t * | out |
| ) |  |  |

Performs echo cancellation on a frame

void speex_echo_capture | ( | SpeexEchoState * | st,
|  | const spx_int16_t * | rec,
|  | spx_int16_t * | out |
| ) |  |  |

Perform echo cancellation using internal playback buffer, which is delayed by two frames to account for the delay introduced by most soundcards (but it could be off!)

Parameters:

  | st | Echo canceller state
  | rec | Signal from the microphone (near end + far end echo)
  | out | Returns near-end signal with echo removed

int speex_echo_ctl | ( | SpeexEchoState * | st,
|  | int | request,
|  | void * | ptr |
| ) |  |  |

Used like the ioctl function to control the echo canceller parameters

Parameters:

  | st | Echo canceller state
  | request | ioctl-type request (one of the SPEEX_ECHO_* macros)
  | ptr | Data exchanged to-from function

Returns:
  0 if no error, -1 if request in unknown

void speex_echo_playback | ( | SpeexEchoState * | st,
|  | const spx_int16_t * | play |
| ) |  |  |

Let the echo canceller know that a frame was just queued to the soundcard

Parameters:

  | st | Echo canceller state
  | play | Signal played to the speaker (received from far end)

void speex_echo_state_destroy | ( | SpeexEchoState * | st | ) |

Destroys an echo canceller state

SpeexEchoState* speex_echo_state_init | ( | int | frame_size,
|  | int | filter_length |
| ) |  |  |

Creates a new echo canceller state

void speex_echo_state_reset | ( | SpeexEchoState * | st | ) |

Resets echo canceller state