diff options
-rw-r--r-- | pjmedia/include/pjmedia/config.h | 21 | ||||
-rw-r--r-- | pjmedia/src/pjmedia/echo_speex.c | 10 |
2 files changed, 29 insertions, 2 deletions
diff --git a/pjmedia/include/pjmedia/config.h b/pjmedia/include/pjmedia/config.h index c075538b..8bd622ba 100644 --- a/pjmedia/include/pjmedia/config.h +++ b/pjmedia/include/pjmedia/config.h @@ -636,6 +636,27 @@ /** + * Specify whether Automatic Gain Control (AGC) should also be enabled in + * Speex AEC. + * + * Default: 1 (yes) + */ +#ifndef PJMEDIA_SPEEX_AEC_USE_AGC +# define PJMEDIA_SPEEX_AEC_USE_AGC 1 +#endif + + +/** + * Specify whether denoise should also be enabled in Speex AEC. + * + * Default: 1 (yes) + */ +#ifndef PJMEDIA_SPEEX_AEC_USE_DENOISE +# define PJMEDIA_SPEEX_AEC_USE_DENOISE 1 +#endif + + +/** * Maximum number of parameters in SDP fmtp attribute. * * Default: 16 diff --git a/pjmedia/src/pjmedia/echo_speex.c b/pjmedia/src/pjmedia/echo_speex.c index 18f42b3b..fca460eb 100644 --- a/pjmedia/src/pjmedia/echo_speex.c +++ b/pjmedia/src/pjmedia/echo_speex.c @@ -109,11 +109,17 @@ PJ_DEF(pj_status_t) speex_aec_create(pj_pool_t *pool, &enabled); #endif - /* Enable AGC */ + /* Enable/disable AGC & denoise */ { - spx_int32_t enabled = 1; + spx_int32_t enabled; + + enabled = PJMEDIA_SPEEX_AEC_USE_AGC; speex_preprocess_ctl(echo->preprocess, SPEEX_PREPROCESS_SET_AGC, &enabled); + + enabled = PJMEDIA_SPEEX_AEC_USE_DENOISE; + speex_preprocess_ctl(echo->preprocess, SPEEX_PREPROCESS_SET_DENOISE, + &enabled); } /* Control echo cancellation in the preprocessor */ |