bowen liu / Mbed OS mbed-os-example-blinky

Fork of mbed-os-example-mbed5-blinky by mbed-os-examples

Embed: (wiki syntax)

« Back to documentation index

SpeexPreprocessState: The Speex preprocessor

SpeexPreprocessState: The Speex preprocessor

This is the Speex preprocessor. More...

Typedefs

typedef struct
SpeexPreprocessState_ 
SpeexPreprocessState
 State of the preprocessor (one per channel).

Functions

SpeexPreprocessStatespeex_preprocess_state_init (int frame_size, int sampling_rate)
 Creates a new preprocessing state.
void speex_preprocess_state_destroy (SpeexPreprocessState *st)
 Destroys a preprocessor state.
int speex_preprocess_run (SpeexPreprocessState *st, spx_int16_t *x)
 Preprocess a frame.
int speex_preprocess (SpeexPreprocessState *st, spx_int16_t *x, spx_int32_t *echo)
 Preprocess a frame (deprecated, use speex_preprocess_run() instead)
void speex_preprocess_estimate_update (SpeexPreprocessState *st, spx_int16_t *x)
 Update preprocessor state, but do not compute the output.
int speex_preprocess_ctl (SpeexPreprocessState *st, int request, void *ptr)
 Used like the ioctl function to control the preprocessor parameters.

Detailed Description

This is the Speex preprocessor.

The preprocess can do noise suppression, residual echo suppression (after using the echo canceller), automatic gain control (AGC) and voice activity detection (VAD).


Typedef Documentation

typedef struct SpeexPreprocessState_ SpeexPreprocessState

State of the preprocessor (one per channel).

Should never be accessed directly.

Definition at line 56 of file speex_preprocess.h.


Function Documentation

int speex_preprocess ( SpeexPreprocessState st,
spx_int16_t *  x,
spx_int32_t *  echo 
)

Preprocess a frame (deprecated, use speex_preprocess_run() instead)

int speex_preprocess_ctl ( SpeexPreprocessState st,
int  request,
void *  ptr 
)

Used like the ioctl function to control the preprocessor parameters.

Parameters:
stPreprocessor state
requestioctl-type request (one of the SPEEX_PREPROCESS_* macros)
ptrData exchanged to-from function
Returns:
0 if no error, -1 if request in unknown
void speex_preprocess_estimate_update ( SpeexPreprocessState st,
spx_int16_t *  x 
)

Update preprocessor state, but do not compute the output.

Parameters:
stPreprocessor state
xAudio sample vector (in only). Must be same size as specified in speex_preprocess_state_init().
int speex_preprocess_run ( SpeexPreprocessState st,
spx_int16_t *  x 
)

Preprocess a frame.

Parameters:
stPreprocessor state
xAudio sample vector (in and out). Must be same size as specified in speex_preprocess_state_init().
Returns:
Bool value for voice activity (1 for speech, 0 for noise/silence), ONLY if VAD turned on.
void speex_preprocess_state_destroy ( SpeexPreprocessState st )

Destroys a preprocessor state.

Parameters:
stPreprocessor state to destroy
SpeexPreprocessState* speex_preprocess_state_init ( int  frame_size,
int  sampling_rate 
)

Creates a new preprocessing state.

You MUST create one state per channel processed.

Parameters:
frame_sizeNumber of samples to process at one time (should correspond to 10-20 ms). Must be the same value as that used for the echo canceller for residual echo cancellation to work.
sampling_rateSampling rate used for the input.
Returns:
Newly created preprocessor state