👍️[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,6 +137,7 @@ class DeviceManager:
enumerator.RegisterEndpointNotificationCallback(cb) enumerator.RegisterEndpointNotificationCallback(cb)
try: try:
while self.monitoring_flag is True: while self.monitoring_flag is True:
try:
while cb.loop is True: while cb.loop is True:
sleep(1) sleep(1)
enumerator.UnregisterEndpointNotificationCallback(cb) enumerator.UnregisterEndpointNotificationCallback(cb)
@@ -144,7 +145,9 @@ class DeviceManager:
sleep(2) sleep(2)
self.update() self.update()
self.noticeDefaultDevice() self.noticeDefaultDevice()
except Exception:
pass
finally:
cb = Client() cb = Client()
enumerator = AudioUtilities.GetDeviceEnumerator() enumerator = AudioUtilities.GetDeviceEnumerator()
enumerator.RegisterEndpointNotificationCallback(cb) enumerator.RegisterEndpointNotificationCallback(cb)