Jelajahi Sumber

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

lsfoo 4 bulan lalu
induk
melakukan
482679b938
1 mengubah file dengan 5 tambahan dan 0 penghapusan
  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: