[Speex-dev] Newbie: Get echo cancellation level

Jean-Marc Valin jean-marc.valin at usherbrooke.ca
Wed Sep 24 04:30:29 PDT 2008

p_j_r_m a écrit :
> I'm using speex to perform echo cancellation in Windows. I'm aware of
> the problem about out of sync clocks in record and play sample rates in
> usual sound cards . In order to have an idea of how good is my echo
> cancelation working I would like to know if there is any #define thing i
> can pass to speex_echo_ctl to get the actual level of echo cancellation.
> If not, how can i extract that value from the library?

You can look at st->leak-estimate within mdf.c, but it's not exposed
through the API and is *very* approximate (if I really knew how well the
AEC was doing, I could cancel much better). A value of 0 for
leak_estimate means "perfect cancellation", while a value of 1 means no
cancellation. Then, .1 means -10 dB and so on.

> By the way, is any software solution for out of sync problem ? I'm
> trying to keep input and output buffers adjusted by resampling, but it
> does not work well.

That approach would be really tough at best. Just not worth spending my
time on it.


More information about the Speex-dev mailing list