query device exception handling

This commit is contained in:
wataru 2023-06-16 16:12:15 +09:00
parent ca9bac0942
commit 4d55e19bd0

View File

@ -15,7 +15,11 @@ class ServerAudioDevice:
def list_audio_device():
audioDeviceList = sd.query_devices()
try:
audioDeviceList = sd.query_devices()
except Exception as e:
print("[Voice Changer] ex:query_devices")
print(e)
inputAudioDeviceList = [d for d in audioDeviceList if d["max_input_channels"] > 0]
outputAudioDeviceList = [d for d in audioDeviceList if d["max_output_channels"] > 0]