- Timestamp:
- Aug 7, 2006 10:24:52 AM (18 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/config.h
r653 r658 162 162 163 163 /** 164 * Suggested or default threshold to be set for fixed silence detection 165 * or as starting threshold for adaptive silence detection. The threshold 166 * has the range from zero to 255. 167 */ 168 #ifndef PJMEDIA_SILENCE_DET_THRESHOLD 169 # define PJMEDIA_SILENCE_DET_THRESHOLD 4 170 #endif 171 172 173 /** 164 174 * G.711 Appendix I Packet Lost Concealment (PLC). 165 175 * Enabled only when floating point is enabled. … … 176 186 #ifndef PJMEDIA_HAS_SPEEX_AEC 177 187 # define PJMEDIA_HAS_SPEEX_AEC 1 188 #endif 189 190 191 /** 192 * Initial signal threshold to be applied to echo suppressor. When 193 * playback signal level is greater than this threshold, the microphone 194 * signal will be reduced or cut. 195 */ 196 #ifndef PJMEDIA_ECHO_SUPPRESS_THRESHOLD 197 # define PJMEDIA_ECHO_SUPPRESS_THRESHOLD PJMEDIA_SILENCE_DET_THRESHOLD 198 #endif 199 200 201 /** 202 * The signal reduction factor to be applied into the microphone signal 203 * when the mic signal needs to be reduced. Valid values are [1-16], where 204 * 1 will leave signal as it is (thus probably transmitting the echo) and 205 * 16 will effectively zero the signal. 206 */ 207 #ifndef PJMEDIA_ECHO_SUPPRESS_FACTOR 208 # define PJMEDIA_ECHO_SUPPRESS_FACTOR 4 178 209 #endif 179 210 -
pjproject/trunk/pjmedia/include/pjmedia/silencedet.h
r655 r658 44 44 typedef struct pjmedia_silence_det pjmedia_silence_det; 45 45 46 47 /**48 * Suggested or default threshold to be set for fixed silence detection49 * or as starting threshold for adaptive silence detection. The threshold50 * has the range from zero to 255.51 */52 #define PJMEDIA_SILENCE_DET_THRESHOLD 453 46 54 47 -
pjproject/trunk/pjmedia/include/pjmedia/sound_port.h
r653 r658 198 198 * miliseconds. If zero is specified, the EC would 199 199 * be disabled. 200 * @param options The options to be passed to #pjmedia_echo_create(). 200 201 * 201 202 * @return PJ_SUCCESS on success. 202 203 */ 203 PJ_DECL(pj_status_t) pjmedia_snd_port_set_ec_tail(pjmedia_snd_port *snd_port, 204 pj_pool_t *pool, 205 unsigned tail_ms); 204 PJ_DECL(pj_status_t) pjmedia_snd_port_set_ec( pjmedia_snd_port *snd_port, 205 pj_pool_t *pool, 206 unsigned tail_ms, 207 unsigned options); 206 208 207 209 -
pjproject/trunk/pjmedia/src/pjmedia/echo_suppress.c
r656 r658 28 28 29 29 #define THIS_FILE "echo_suppress.c" 30 #define PJMEDIA_ECHO_SUPPRESS_THRESHOLD PJMEDIA_SILENCE_DET_THRESHOLD31 30 32 31 … … 160 159 161 160 if (delay_ms < ec->tail_ms) { 161 #if defined(PJMEDIA_ECHO_SUPPRESS_FACTOR) && PJMEDIA_ECHO_SUPPRESS_FACTOR!=0 162 unsigned i; 163 for (i=0; i<ec->samples_per_frame; ++i) { 164 rec_frm[i] = (pj_int16_t)(rec_frm[i] >> 165 PJMEDIA_ECHO_SUPPRESS_FACTOR); 166 } 167 #else 162 168 pjmedia_zero_samples(rec_frm, ec->samples_per_frame); 169 #endif 163 170 } 164 171 … … 186 193 187 194 if (!silence) { 195 #if defined(PJMEDIA_ECHO_SUPPRESS_FACTOR) && PJMEDIA_ECHO_SUPPRESS_FACTOR!=0 196 unsigned i; 197 for (i=0; i<ec->samples_per_frame; ++i) { 198 rec_frm[i] = (pj_int16_t)(rec_frm[i] >> 199 PJMEDIA_ECHO_SUPPRESS_FACTOR); 200 } 201 #else 188 202 pjmedia_zero_samples(rec_frm, ec->samples_per_frame); 189 } 190 191 return PJ_SUCCESS; 192 } 193 194 203 #endif 204 } 205 206 return PJ_SUCCESS; 207 } 208 -
pjproject/trunk/pjmedia/src/pjmedia/sound_port.c
r653 r658 250 250 } 251 251 252 /* Create AEC only when direction is full duplex */253 if (snd_port->dir == PJMEDIA_DIR_CAPTURE_PLAYBACK) {254 status = pjmedia_snd_port_set_ec_tail(snd_port, pool, AEC_TAIL);255 if (status != PJ_SUCCESS) {256 PJ_LOG(4,(THIS_FILE, "Unable to create AEC"));257 snd_port->ec_state = NULL;258 }259 }260 252 261 253 /* Start sound stream. */ … … 433 425 * Enable AEC 434 426 */ 435 PJ_DEF(pj_status_t) pjmedia_snd_port_set_ec_tail(pjmedia_snd_port *snd_port, 436 pj_pool_t *pool, 437 unsigned tail_ms) 427 PJ_DEF(pj_status_t) pjmedia_snd_port_set_ec( pjmedia_snd_port *snd_port, 428 pj_pool_t *pool, 429 unsigned tail_ms, 430 unsigned options) 438 431 { 439 432 pj_status_t status; … … 455 448 status = pjmedia_echo_create(pool, snd_port->clock_rate, 456 449 snd_port->samples_per_frame, 457 tail_ms, 0, &snd_port->ec_state);450 tail_ms, options, &snd_port->ec_state); 458 451 if (status != PJ_SUCCESS) 459 452 snd_port->ec_state = NULL; -
pjproject/trunk/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp
r656 r658 39 39 }; 40 40 41 #define DEFAULT_URI "sip:192.168.0. 66"41 #define DEFAULT_URI "sip:192.168.0.7" 42 42 43 43 … … 285 285 /* Setup media */ 286 286 media_cfg.clock_rate = 8000; 287 //media_cfg.ec_tail_len =;287 media_cfg.ec_options = PJMEDIA_ECHO_SIMPLE; 288 288 media_cfg.quality = 1; 289 289 media_cfg.ptime = 20; -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r653 r658 2134 2134 2135 2135 /** 2136 * Echo canceller options (see #pjmedia_echo_create()) 2137 * 2138 * Default: 0. 2139 */ 2140 unsigned ec_options; 2141 2142 /** 2136 2143 * Echo canceller tail length, in miliseconds. 2137 2144 * … … 2507 2514 * @param tail_ms The tail length, in miliseconds. Set to zero to 2508 2515 * disable AEC. 2516 * @param options Options to be passed to #pjmedia_echo_create(). 2517 * Normally the value should be zero. 2509 2518 * 2510 2519 * @return PJ_SUCCESS on success. 2511 2520 */ 2512 PJ_DECL(pj_status_t) pjsua_set_ec _tail(unsigned tail_ms);2521 PJ_DECL(pj_status_t) pjsua_set_ec(unsigned tail_ms, unsigned options); 2513 2522 2514 2523 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r653 r658 970 970 971 971 /* Set AEC */ 972 pjmedia_snd_port_set_ec_tail(pjsua_var.snd_port, pjsua_var.pool, 973 pjsua_var.media_cfg.ec_tail_len); 972 pjmedia_snd_port_set_ec( pjsua_var.snd_port, pjsua_var.pool, 973 pjsua_var.media_cfg.ec_tail_len, 974 pjsua_var.media_cfg.ec_options); 974 975 975 976 /* Connect sound port to the bridge */ … … 1045 1046 * Configure the AEC settings of the sound port. 1046 1047 */ 1047 PJ_DEF(pj_status_t) pjsua_set_ec _tail(unsigned tail_ms)1048 PJ_DEF(pj_status_t) pjsua_set_ec(unsigned tail_ms, unsigned options) 1048 1049 { 1049 1050 pjsua_var.media_cfg.ec_tail_len = tail_ms; 1050 1051 1051 1052 if (pjsua_var.snd_port) 1052 return pjmedia_snd_port_set_ec _tail(pjsua_var.snd_port, pjsua_var.pool,1053 tail_ms);1053 return pjmedia_snd_port_set_ec( pjsua_var.snd_port, pjsua_var.pool, 1054 tail_ms, options); 1054 1055 1055 1056 return PJ_SUCCESS;
Note: See TracChangeset
for help on using the changeset viewer.