Przeglądaj źródła

讯飞asr测试,debug

Davidliu 2 miesięcy temu
rodzic
commit
cf5cb49592
2 zmienionych plików z 4 dodań i 4 usunięć
  1. 1 1
      src/core/voip/asr.py
  2. 3 3
      src/core/voip/bot.py

+ 1 - 1
src/core/voip/asr.py

@@ -269,7 +269,7 @@ class XfAsr:
     #     print("send end tag success")
 
     def send_audio(self, chunk):
-        self.logger.info('xunfei.Asr.send_audio:chunk:%s', chunk)
+        # self.logger.info('xunfei.Asr.send_audio:chunk:%s', chunk)
         if self.ws:
             self.ws.send(chunk)
 

+ 3 - 3
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.debug("Received audio frame: %s, %s %s", self.call.session_id,frame.buf, frame.size)
+            # if self.first:
+            #     self.first = False
+            self.call.logger.debug("Received audio frame: %s, %s %s", self.call.session_id,frame.buf, frame.size)
             self.asr.send_audio(frame.buf)
 
         try: