00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifdef __cplusplus
00036 extern "C" {
00037 #endif
00038
00039 struct drft_lookup;
00040
00041 typedef struct SpeexPreprocessState {
00042 int frame_size;
00043 int ps_size;
00044 int sampling_rate;
00046
00047 int denoise_enabled;
00048 int agc_enabled;
00049 float agc_level;
00050 int vad_enabled;
00051
00052 float *frame;
00053 float *ps;
00054 float *gain2;
00055 float *window;
00056 float *noise;
00057 float *old_ps;
00058 float *gain;
00059 float *prior;
00060 float *post;
00062 float *S;
00063 float *Smin;
00064 float *Stmp;
00065 float *update_prob;
00067 float *zeta;
00068 float Zpeak;
00069 float Zlast;
00070
00071 float *loudness_weight;
00073 float *echo_noise;
00074
00075 float *noise_bands;
00076 float *noise_bands2;
00077 int noise_bandsN;
00078 float *speech_bands;
00079 float *speech_bands2;
00080 int speech_bandsN;
00081
00082 float *inbuf;
00083 float *outbuf;
00085 float speech_prob;
00086 int last_speech;
00087 float loudness;
00088 float loudness2;
00089 int nb_adapt;
00090 int nb_loudness_adapt;
00091 int consec_noise;
00092 int nb_preprocess;
00093 struct drft_lookup *fft_lookup;
00095 } SpeexPreprocessState;
00096
00098 SpeexPreprocessState *speex_preprocess_state_init(int frame_size, int sampling_rate);
00099
00101 void speex_preprocess_state_destroy(SpeexPreprocessState *st);
00102
00104 int speex_preprocess(SpeexPreprocessState *st, short *x, float *noise);
00105
00107 void speex_preprocess_estimate_update(SpeexPreprocessState *st, short *x, float *noise);
00108
00110 int speex_preprocess_ctl(SpeexPreprocessState *st, int request, void *ptr);
00111
00112
00113
00114 #define SPEEX_PREPROCESS_SET_DENOISE 0
00115 #define SPEEX_PREPROCESS_GET_DENOISE 1
00116
00117 #define SPEEX_PREPROCESS_SET_AGC 2
00118 #define SPEEX_PREPROCESS_GET_AGC 3
00119
00120 #define SPEEX_PREPROCESS_SET_VAD 4
00121 #define SPEEX_PREPROCESS_GET_VAD 5
00122
00123 #define SPEEX_PREPROCESS_SET_AGC_LEVEL 6
00124 #define SPEEX_PREPROCESS_GET_AGC_LEVEL 7
00125
00126 #ifdef __cplusplus
00127 }
00128 #endif