static void volume_init(MSFilter *f){ Volume *v=(Volume*)ms_new0(Volume,1); v->energy=0; v->level_pk = 0; v->static_gain = v->gain = v->target_gain = 1; v->dc_offset = 0; v->vol_upramp = vol_upramp; v->vol_fast_upramp=vol_upramp*3; v->vol_downramp = vol_downramp; v->ea_thres = noise_thres; v->ea_transmit_thres=transmit_thres; v->force=en_weight; v->peer=NULL; v->sustain_time=200; v->sustain_dur = 0; v->agc_enabled=FALSE; v->buffer=ms_bufferizer_new(); v->sample_rate=8000; v->nsamples=80; v->noise_gate_enabled=FALSE; v->ng_cut_time = 400;/*TODO: ng_sustain (milliseconds)*/ v->ng_noise_dur=0; v->ng_threshold=noise_thres; v->ng_floorgain=min_ng_floorgain; v->ng_gain = 1; v->remove_dc=FALSE; #ifdef HAVE_SPEEXDSP v->speex_pp=NULL; #endif ortp_extremum_init(&v->max,1000); ortp_extremum_init(&v->min,30000); f->data=v; }
static void vad_dtx_init(MSFilter *f){ VadDtxContext *ctx=ms_new0(VadDtxContext,1); f->data=ctx; ortp_extremum_init(&ctx->max,2000); }