Browse Source

feat: 激活工位语音播报到站,修复 COM 线程初始化

lsfoo 4 tháng trước cách đây
mục cha
commit
482679b938
1 tập tin đã thay đổi với 5 bổ sung và 0 xóa
  1. 5 0
      hookvision/main_window.py

+ 5 - 0
hookvision/main_window.py

@@ -277,6 +277,11 @@ class MainWindow(QMainWindow):
         self._voice_queue.put(msg)
 
     def _voice_worker(self):
+        try:
+            import pythoncom
+            pythoncom.CoInitialize()
+        except ImportError:
+            pass
         while True:
             msg = self._voice_queue.get()
             if msg is None: