shanghui 3 月之前
父节点
当前提交
2faea6c596
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      src/core/voip/bot.py

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

@@ -148,10 +148,14 @@ class MyAudioMediaPlayer(pj.AudioMediaPlayer):
 
     def onEof2(self):
         # self.stopTransmit(self.sink)
+        threading.Thread(target=self._handle_on_complete, daemon=True).start()
+        # if self.on_complete:
+        #     self.on_complete(self.player_id)
+
+    def _handle_on_complete(self):
         if self.on_complete:
             self.on_complete(self.player_id)
 
-
 # Subclass to extend the Account and get notifications etc.
 class Account(pj.Account):
     def __init__(self, agent, user_part, **kwargs):
@@ -345,7 +349,8 @@ class MyCall(pj.Call):
         self.digit = ''
         self.inputLongStart = time.time()
         #播放完毕执行的动作
-        self.say_end_action(self.action)
+        threading.Thread(target=self._handle_say_end_action, args=(self.action,), daemon=True).start()
+        # self.say_end_action(self.action)
 
     def bot_say_hello(self):
         self.chat(user_asr_text="start")