👍️[Update] Controller : transcription実行時にDeviceの自動切り替え処理が動作しない問題を修正

This commit is contained in:
misyaguziya
2024-09-27 21:58:48 +09:00
parent 12a2eb420a
commit 0b29ad8321

View File

@@ -137,17 +137,20 @@ class DeviceManager:
enumerator.RegisterEndpointNotificationCallback(cb) enumerator.RegisterEndpointNotificationCallback(cb)
try: try:
while self.monitoring_flag is True: while self.monitoring_flag is True:
while cb.loop is True: try:
sleep(1) while cb.loop is True:
enumerator.UnregisterEndpointNotificationCallback(cb) sleep(1)
self.runPrevUpdateDevices() enumerator.UnregisterEndpointNotificationCallback(cb)
sleep(2) self.runPrevUpdateDevices()
self.update() sleep(2)
self.noticeDefaultDevice() self.update()
self.noticeDefaultDevice()
cb = Client() except Exception:
enumerator = AudioUtilities.GetDeviceEnumerator() pass
enumerator.RegisterEndpointNotificationCallback(cb) finally:
cb = Client()
enumerator = AudioUtilities.GetDeviceEnumerator()
enumerator.RegisterEndpointNotificationCallback(cb)
except Exception: except Exception:
pass pass
comtypes.CoUninitialize() comtypes.CoUninitialize()