Browse Source

讯飞asr测试,debug

Davidliu 1 month ago
parent
commit
004247cc16
1 changed files with 5 additions and 5 deletions
  1. 5 5
      src/core/voip/bot.py

+ 5 - 5
src/core/voip/bot.py

@@ -80,9 +80,9 @@ class MyAudioMediaPort(pj.AudioMediaPort):
     def onFrameReceived(self, frame):
         # self.wav.writeframes(bytes(frame.buf))
         if self.asr:  # 如果ASR实例存在,则发送音频数据
-            # if self.first:
-            #     self.first = False
-            self.call.logger.warn("Received audio frame: %s, %s, %s, %s", self.call.session_id,frame.buf, len(frame.buf),frame.size)
+            if self.first:
+                self.first = False
+                self.call.logger.warn("Received audio frame: %s, %s, %s", self.call.session_id,frame.buf,frame.size)
             self.asr.send_audio(frame.buf)
 
         try:
@@ -615,8 +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.ptime = 40
+            # media_cfg.audioFramePtime = 40
+            # media_cfg.ptime = 40
             # media_cfg.clockRate = 8000
             self.ep.medConfig = media_cfg  # Apply media config to endpoint