This is how it is expected to be run.
fwrite(pdata, 1, u->blocksize, u->played_file);
}
fwrite(pdata, 1, u->blocksize, u->played_file);
}
- if (u->ec->pp_state)
- speex_preprocess_run(u->ec->pp_state, (spx_int16_t *) rdata);
-
/* perform echo cancelation */
u->ec->run(u->ec, rdata, pdata, cdata);
/* perform echo cancelation */
u->ec->run(u->ec, rdata, pdata, cdata);
+ /* preprecessor is run after AEC. This is not a mistake! */
+ if (u->ec->pp_state)
+ speex_preprocess_run(u->ec->pp_state, (spx_int16_t *) cdata);
+
if (u->save_aec) {
if (u->canceled_file)
fwrite(cdata, 1, u->blocksize, u->canceled_file);
if (u->save_aec) {
if (u->canceled_file)
fwrite(cdata, 1, u->blocksize, u->canceled_file);