Browse Source

讯飞asr测试,debug

Davidliu 1 month ago
parent
commit
2604293f39
2 changed files with 4 additions and 3 deletions
  1. 2 1
      src/core/voip/bot.py
  2. 2 2
      src/core/voip/constant.py

+ 2 - 1
src/core/voip/bot.py

@@ -615,7 +615,8 @@ class BotAgent:
             media_cfg.jbMaxPre = 16  # Maximum pre-fetch frames
             media_cfg.noVad = True  # Disable Voice Activity Detection if needed
             media_cfg.clockRate = 16000
-            # media_cfg.audioFramePtime = 40
+            media_cfg.channelCount = 1
+            media_cfg.audioFramePtime = 40
             # media_cfg.ptime = 40
             # media_cfg.clockRate = 8000
             self.ep.medConfig = media_cfg  # Apply media config to endpoint

+ 2 - 2
src/core/voip/constant.py

@@ -23,9 +23,9 @@ def build_audio_format():
     fmt.bitsPerSample = 16  # 每个采样的位数
     # fmt.clockRate = 8000  # 采样率
     fmt.clockRate = 16000  # 采样率
-    fmt.frameTimeUsec = 12500  # 每帧的时间(20 毫秒)
+    fmt.frameTimeUsec = 40000
     # fmt.clockRate = 16000  # 采样率
-    # fmt.frameTimeUsec = 20000  # 每帧的时间(20 毫秒)
+    # fmt.frameTimeUsec = 20000
     return fmt