From 27b4964cb983832789c8b4c2fc06f055848e6f26 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Fri, 24 May 2024 09:57:20 +0200 Subject: [PATCH] Update media.py --- lollms/media.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lollms/media.py b/lollms/media.py index 7b0676a..8613a6c 100644 --- a/lollms/media.py +++ b/lollms/media.py @@ -141,10 +141,10 @@ class RTCom: if snd_input_device is None: devices = sd.query_devices() - snd_input_device = [device['name'] for device in devices if device['type'] == 'input'][0] + snd_input_device = [device['name'] for device in devices if device["max_input_channels"]>0][0] if snd_output_device is None: devices = sd.query_devices() - snd_output_device = [device['name'] for device in devices if device['type'] == 'output'][0] + snd_output_device = [device['name'] for device in devices if device["max_output_channels"]>0][0] self.snd_input_device = snd_input_device self.snd_output_device = snd_output_device @@ -574,4 +574,4 @@ class RealTimeTranscription: # Stop the stream and clean up self.stream.stop_stream() self.stream.close() - self.p.terminate() \ No newline at end of file + self.p.terminate()