pjsip回音消除

语言: CN / TW / HK

pjsip回音消除

1. pjmedia_echo_flag enum 初始化参数

  • 算法位 掩码: PJMEDIA_ECHO_ALGO_MASK = 15,
算法类型:
PJMEDIA_ECHO_DEFAULT = 0 默认也是speex
PJMEDIA_ECHO_SPEEX	= 1
PJMEDIA_ECHO_SIMPLE	= 2
PJMEDIA_ECHO_WEBRTC = 3
提取方式 (option & PJMEDIA_ECHO_ALGO_MASK);  //取最后字节
  • 仅使用软件实现
PJMEDIA_ECHO_USE_SW_ECHO = 64,
  • 同时也使用噪音抑制
PJMEDIA_ECHO_USE_NOISE_SUPPRESSOR = 128, (0x80)
  • 回音消除的激烈模式
PJMEDIA_ECHO_AGGRESSIVENESS_MASK = 0xF00, //掩码位
PJMEDIA_ECHO_AGGRESSIVENESS_DEFAULT = 0, 默认moderate
PJMEDIA_ECHO_AGGRESSIVENESS_CONSERVATIVE = 0x100,
PJMEDIA_ECHO_AGGRESSIVENESS_MODERATE = 0x200,
PJMEDIA_ECHO_AGGRESSIVENESS_AGGRESSIVE = 0x300,

2. pjmedia_echo_stat 统计信息

  • median, Echo delay median value (in ms).
  • std, Echo delay standard deviation (in ms).
  • frac_delay, Fraction of poor delay. Value between 0 to 1.
  • learning, Learning still in progress?
  • duration,Learning duration (in ms).
  • tail,Detected echo tail length (in ms).
  • min_factor,Minimum scaling factor (in ms).
  • avg_factor, Average scaling factor (in ms).
  • buf_, Internal buffer.

3. 创建、重置、销毁

  • pjmedia_echo_create
  • pjmedia_echo_create2
  • pjmedia_echo_reset
  • pjmedia_echo_destroy

4. 获取统计信息

  • pjmedia_echo_get_stat

5. 回音消除处理逻辑

  • pjmedia_echo_playback 送给喇叭之前先发给ec
  • pjmedia_echo_capture 麦克风采集到数据先发给ec
  • pjmedia_echo_cancel 进行回音消除处理\噪音抑制, 得到结果