static void volume_preprocess(MSFilter *f){ Volume *v=(Volume*)f->data; /*process agc by chunks of 10 ms*/ v->nsamples=(int)(0.01*(float)v->sample_rate); if (v->agc_enabled){ ms_message("AGC is enabled."); #if defined HAVE_SPEEXDSP && !defined MS_FIXED_POINT if (v->speex_pp==NULL){ int tmp=1; v->speex_pp=speex_preprocess_state_init(v->nsamples,v->sample_rate); if (speex_preprocess_ctl(v->speex_pp,SPEEX_PREPROCESS_SET_AGC,&tmp)==-1){ ms_warning("Speex AGC is not available."); } tmp=0; speex_preprocess_ctl(v->speex_pp,SPEEX_PREPROCESS_SET_VAD,&tmp); speex_preprocess_ctl(v->speex_pp,SPEEX_PREPROCESS_SET_DENOISE,&tmp); speex_preprocess_ctl(v->speex_pp,SPEEX_PREPROCESS_SET_DEREVERB,&tmp); } #endif } ortp_extremum_reset(&v->min); ortp_extremum_reset(&v->max); }
static void vad_dtx_preprocess(MSFilter *f){ VadDtxContext *ctx=(VadDtxContext*)f->data; ortp_extremum_reset(&ctx->max); }