]> code.delx.au - pulseaudio/commitdiff
echo-cancel: Fix preprocessor initialisation
authorArun Raghavan <arun.raghavan@collabora.co.uk>
Mon, 13 Jun 2011 20:40:33 +0000 (13:40 -0700)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Mon, 13 Jun 2011 22:25:32 +0000 (15:25 -0700)
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.

src/modules/echo-cancel/module-echo-cancel.c

index cb308329346b153fb8f19344c91d1063ae9f59c1..c406508c9f2d55c4e51b2e63a1bf573e0f299182 100644 (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);