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 進行迴音消除處理\噪音抑制, 得到結果