echo-cancel: Fix preprocessor initialisation

We were using the block size in bytes instead of samples, which meant
preprocessing was broken. This fix makes a large-ish difference in the
quality of echo-cancellation with speex.
This commit is contained in:
Arun Raghavan 2011-06-13 13:40:33 -07:00
parent fc0eebf2c4
commit b2f83b2502

View file

@ -1481,7 +1481,7 @@ int pa__init(pa_module*m) {
goto fail;
}
u->ec->pp_state = speex_preprocess_state_init(u->blocksize, source_ss.rate);
u->ec->pp_state = speex_preprocess_state_init(u->blocksize / pa_frame_size(&source_ss), source_ss.rate);
speex_preprocess_ctl(u->ec->pp_state, SPEEX_PREPROCESS_SET_AGC, &u->ec->agc);
speex_preprocess_ctl(u->ec->pp_state, SPEEX_PREPROCESS_SET_DENOISE, &u->ec->denoise);