This is the acoustic echo canceller module.
More...
|
typedef struct SpeexEchoState_ | SpeexEchoState |
|
typedef struct SpeexDecorrState_ | SpeexDecorrState |
|
|
SpeexEchoState * | speex_echo_state_init (int frame_size, int filter_length) |
|
SpeexEchoState * | speex_echo_state_init_mc (int frame_size, int filter_length, int nb_mic, int nb_speakers) |
|
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) |
|
SpeexDecorrState * | speex_decorrelate_new (int rate, int channels, int frame_size) |
|
void | speex_decorrelate (SpeexDecorrState *st, const spx_int16_t *in, spx_int16_t *out, int strength) |
|
void | speex_decorrelate_destroy (SpeexDecorrState *st) |
|
This is the acoustic echo canceller module.
◆ SPEEX_ECHO_GET_FRAME_SIZE
#define SPEEX_ECHO_GET_FRAME_SIZE 3 |
Obtain frame size used by the AEC
◆ SPEEX_ECHO_GET_IMPULSE_RESPONSE
#define SPEEX_ECHO_GET_IMPULSE_RESPONSE 29 |
Get impulse response (int32[])
◆ SPEEX_ECHO_GET_IMPULSE_RESPONSE_SIZE
#define SPEEX_ECHO_GET_IMPULSE_RESPONSE_SIZE 27 |
Get size of impulse response (int32)
◆ SPEEX_ECHO_GET_SAMPLING_RATE
#define SPEEX_ECHO_GET_SAMPLING_RATE 25 |
◆ SPEEX_ECHO_SET_SAMPLING_RATE
#define SPEEX_ECHO_SET_SAMPLING_RATE 24 |
◆ SpeexEchoState
Internal echo canceller state. Should never be accessed directly.
◆ speex_decorrelate()
void speex_decorrelate |
( |
SpeexDecorrState * |
st, |
|
|
const spx_int16_t * |
in, |
|
|
spx_int16_t * |
out, |
|
|
int |
strength |
|
) |
| |
Remove correlation between the channels by modifying the phase and possibly adding noise in a way that is not (or little) perceptible.
- Parameters
-
st | Decorrelator state |
in | Input audio in interleaved format |
out | Result of the decorrelation (out may alias in) |
strength | How much alteration of the audio to apply from 0 to 100. |
◆ speex_decorrelate_destroy()
void speex_decorrelate_destroy |
( |
SpeexDecorrState * |
st | ) |
|
Destroy a Decorrelation state
- Parameters
-
◆ speex_decorrelate_new()
SpeexDecorrState* speex_decorrelate_new |
( |
int |
rate, |
|
|
int |
channels, |
|
|
int |
frame_size |
|
) |
| |
Create a state for the channel decorrelation algorithm This is useful for multi-channel echo cancellation only
- Parameters
-
rate | Sampling rate |
channels | Number of channels (it's a bit pointless if you don't have at least 2) |
frame_size | Size of the frame to process at ones (counting samples per channel) |
◆ speex_echo_cancel()
void speex_echo_cancel |
( |
SpeexEchoState * |
st, |
|
|
const spx_int16_t * |
rec, |
|
|
const spx_int16_t * |
play, |
|
|
spx_int16_t * |
out, |
|
|
spx_int32_t * |
Yout |
|
) |
| |
Performs echo cancellation a frame (deprecated)
◆ speex_echo_cancellation()
void speex_echo_cancellation |
( |
SpeexEchoState * |
st, |
|
|
const spx_int16_t * |
rec, |
|
|
const spx_int16_t * |
play, |
|
|
spx_int16_t * |
out |
|
) |
| |
Performs echo cancellation a frame, based on the audio sent to the speaker (no delay is added to playback in this form)
- Parameters
-
st | Echo canceller state |
rec | Signal from the microphone (near end + far end echo) |
play | Signal played to the speaker (received from far end) |
out | Returns near-end signal with echo removed |
◆ speex_echo_capture()
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 |
◆ speex_echo_ctl()
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
◆ speex_echo_playback()
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) |
◆ speex_echo_state_destroy()
Destroys an echo canceller state
- Parameters
-
◆ speex_echo_state_init()
SpeexEchoState* speex_echo_state_init |
( |
int |
frame_size, |
|
|
int |
filter_length |
|
) |
| |
Creates a new echo canceller state
- Parameters
-
frame_size | Number of samples to process at one time (should correspond to 10-20 ms) |
filter_length | Number of samples of echo to cancel (should generally correspond to 100-500 ms) |
- Returns
- Newly-created echo canceller state
◆ speex_echo_state_init_mc()
SpeexEchoState* speex_echo_state_init_mc |
( |
int |
frame_size, |
|
|
int |
filter_length, |
|
|
int |
nb_mic, |
|
|
int |
nb_speakers |
|
) |
| |
Creates a new multi-channel echo canceller state
- Parameters
-
frame_size | Number of samples to process at one time (should correspond to 10-20 ms) |
filter_length | Number of samples of echo to cancel (should generally correspond to 100-500 ms) |
nb_mic | Number of microphone channels |
nb_speakers | Number of speaker channels |
- Returns
- Newly-created echo canceller state
◆ speex_echo_state_reset()
Reset the echo canceller to its original state
- Parameters
-