DavidLiu 3 月之前
父節點
當前提交
27845a2ca7
共有 1 個文件被更改,包括 7 次插入3 次删除
  1. 7 3
      src/core/voip/bot.py

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

@@ -375,12 +375,16 @@ class MyCall(pj.Call):
 
     def release(self):
         self.logger.info('liuwei::debugger::release:: come in ')
+        if self.audio_player and self.aud_media:
+            try:
+                self.audio_player.stopTransmit(self.aud_media)
+                self.audio_player = None  # 或调用播放器停止方法
+                print("Success to stopTransmit:")
+            except pj.Error as e:
+                print("Failed to stopTransmit:", e)
         if self.audio_port:
             # self.audio_port.stopTransmit()
             self.audio_port = None  # 或调用相关销毁方法
-        if self.audio_player:
-            self.audio_player.stopTransmit(self.aud_media)
-            self.audio_player = None  # 或调用播放器停止方法
         if self.aud_media:
             # self.audio_media.stopTransmit()
             self.aud_media = None