Ver Fonte

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

lsfoo há 4 meses atrás
pai
commit
482679b938
1 ficheiros alterados com 5 adições e 0 exclusões
  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: