SpeexPreprocessState: The Speex preprocessor
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).
Define Documentation
#define SPEEX_PREPROCESS_GET_AGC 3 |
Get preprocessor Automatic Gain Control state
#define SPEEX_PREPROCESS_GET_AGC_DECREMENT 29 |
Get maximal gain decrease in dB/second (int32)
#define SPEEX_PREPROCESS_GET_AGC_GAIN 35 |
Get current gain (int32 percent)
#define SPEEX_PREPROCESS_GET_AGC_INCREMENT 27 |
Get maximal gain increase in dB/second (int32)
#define SPEEX_PREPROCESS_GET_AGC_LEVEL 7 |
Get preprocessor Automatic Gain Control level (float)
#define SPEEX_PREPROCESS_GET_AGC_LOUDNESS 33 |
#define SPEEX_PREPROCESS_GET_AGC_MAX_GAIN 31 |
Get maximal gain in dB (int32)
#define SPEEX_PREPROCESS_GET_AGC_TARGET 47 |
Get preprocessor Automatic Gain Control level (int32)
#define SPEEX_PREPROCESS_GET_DENOISE 1 |
Get preprocessor denoiser state
#define SPEEX_PREPROCESS_GET_DEREVERB 9 |
Get preprocessor dereverb state
#define SPEEX_PREPROCESS_GET_DEREVERB_DECAY 13 |
Get preprocessor dereverb decay
#define SPEEX_PREPROCESS_GET_DEREVERB_LEVEL 11 |
Get preprocessor dereverb level
#define SPEEX_PREPROCESS_GET_ECHO_STATE 25 |
Get the corresponding echo canceller state
#define SPEEX_PREPROCESS_GET_ECHO_SUPPRESS 21 |
Get maximum attenuation of the residual echo in dB (negative number)
#define SPEEX_PREPROCESS_GET_ECHO_SUPPRESS_ACTIVE 23 |
Get maximum attenuation of the residual echo in dB when near end is active (negative number)
#define SPEEX_PREPROCESS_GET_NOISE_PSD 43 |
Get noise estimate (int32[] of squared values)
#define SPEEX_PREPROCESS_GET_NOISE_PSD_SIZE 41 |
Get spectrum size for noise estimate (int32)
#define SPEEX_PREPROCESS_GET_NOISE_SUPPRESS 19 |
Get maximum attenuation of the noise in dB (negative number)
#define SPEEX_PREPROCESS_GET_PROB 45 |
Get speech probability in last frame (int32).
#define SPEEX_PREPROCESS_GET_PROB_CONTINUE 17 |
Get probability required for the VAD to stay in the voice state (integer percent)
#define SPEEX_PREPROCESS_GET_PROB_START 15 |
Get probability required for the VAD to go from silence to voice
#define SPEEX_PREPROCESS_GET_PSD 39 |
Get power spectrum (int32[] of squared values)
#define SPEEX_PREPROCESS_GET_PSD_SIZE 37 |
Get spectrum size for power spectrum (int32)
#define SPEEX_PREPROCESS_GET_VAD 5 |
Get preprocessor Voice Activity Detection state
#define SPEEX_PREPROCESS_SET_AGC 2 |
Set preprocessor Automatic Gain Control state
#define SPEEX_PREPROCESS_SET_AGC_DECREMENT 28 |
Set maximal gain decrease in dB/second (int32)
#define SPEEX_PREPROCESS_SET_AGC_INCREMENT 26 |
Set maximal gain increase in dB/second (int32)
#define SPEEX_PREPROCESS_SET_AGC_LEVEL 6 |
Set preprocessor Automatic Gain Control level (float)
#define SPEEX_PREPROCESS_SET_AGC_MAX_GAIN 30 |
Set maximal gain in dB (int32)
#define SPEEX_PREPROCESS_SET_AGC_TARGET 46 |
Set preprocessor Automatic Gain Control level (int32)
#define SPEEX_PREPROCESS_SET_DENOISE 0 |
Set preprocessor denoiser state
#define SPEEX_PREPROCESS_SET_DEREVERB 8 |
Set preprocessor dereverb state
#define SPEEX_PREPROCESS_SET_DEREVERB_DECAY 12 |
Set preprocessor dereverb decay
#define SPEEX_PREPROCESS_SET_DEREVERB_LEVEL 10 |
Set preprocessor dereverb level
#define SPEEX_PREPROCESS_SET_ECHO_STATE 24 |
Set the corresponding echo canceller state so that residual echo suppression can be performed (NULL for no residual echo suppression)
#define SPEEX_PREPROCESS_SET_ECHO_SUPPRESS 20 |
Set maximum attenuation of the residual echo in dB (negative number)
#define SPEEX_PREPROCESS_SET_ECHO_SUPPRESS_ACTIVE 22 |
Set maximum attenuation of the residual echo in dB when near end is active (negative number)
#define SPEEX_PREPROCESS_SET_NOISE_SUPPRESS 18 |
Set maximum attenuation of the noise in dB (negative number)
#define SPEEX_PREPROCESS_SET_PROB_CONTINUE 16 |
Set probability required for the VAD to stay in the voice state (integer percent)
#define SPEEX_PREPROCESS_SET_PROB_START 14 |
Set probability required for the VAD to go from silence to voice
#define SPEEX_PREPROCESS_SET_VAD 4 |
Set preprocessor Voice Activity Detection state
Typedef Documentation
State of the preprocessor (one per channel). Should never be accessed directly.
Function Documentation
Used like the ioctl function to control the preprocessor parameters
- Parameters:
-
| st | Preprocessor state |
| request | ioctl-type request (one of the SPEEX_PREPROCESS_* macros) |
| ptr | Data exchanged to-from function |
- Returns:
- 0 if no error, -1 if request in unknown
Update preprocessor state, but do not compute the output
- Parameters:
-
Preprocess a frame
- Parameters:
-
- Returns:
- Bool value for voice activity (1 for speech, 0 for noise/silence), ONLY if VAD turned on.
Destroys a preprocessor state
- Parameters:
-
| st | Preprocessor state to destroy |
Creates a new preprocessing state. You MUST create one state per channel processed.
- Parameters:
-
| frame_size | Number 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_rate | Sampling rate used for the input. |
- Returns:
- Newly created preprocessor state