From 6c04d496c9a7bc5ed6cdaaced786510a23f45baf Mon Sep 17 00:00:00 2001 From: misyaguziya Date: Sat, 30 Sep 2023 22:51:23 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B[bugfix]=20Model:=20Mic/Speaker?= =?UTF-8?q?=E3=81=AE=E3=83=87=E3=83=90=E3=82=A4=E3=82=B9=E3=81=8CNone?= =?UTF-8?q?=E3=81=AE=E5=A0=B4=E5=90=88=E3=81=ABTranscript=E3=82=82?= =?UTF-8?q?=E3=81=97=E3=81=8F=E3=81=AFCheckEnergy=E3=81=AE=E5=87=A6?= =?UTF-8?q?=E7=90=86=E3=82=92=E3=81=97=E3=81=AA=E3=81=84=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=83=95=E3=82=A7=E3=83=BC=E3=83=AB=E3=82=BB=E3=83=BC?= =?UTF-8?q?=E3=83=95=E5=87=A6=E7=90=86=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/model.py b/model.py index 1bb20dbd..e398c3ba 100644 --- a/model.py +++ b/model.py @@ -253,6 +253,9 @@ class Model: return False def startMicTranscript(self, fnc): + if config.CHOICE_MIC_HOST == "None" or config.CHOICE_MIC_DEVICE == "None": + return + mic_audio_queue = Queue() device = [device for device in getInputDevices()[config.CHOICE_MIC_HOST] if device["name"] == config.CHOICE_MIC_DEVICE][0] record_timeout = config.INPUT_MIC_RECORD_TIMEOUT @@ -294,6 +297,9 @@ class Model: self.mic_audio_recorder = None def startCheckMicEnergy(self, fnc): + if config.CHOICE_MIC_HOST == "None" or config.CHOICE_MIC_DEVICE == "None": + return + def sendMicEnergy(): if mic_energy_queue.empty() is False: energy = mic_energy_queue.get() @@ -320,6 +326,8 @@ class Model: self.mic_energy_recorder = None def startSpeakerTranscript(self, fnc): + if config.CHOICE_SPEAKER_DEVICE == "None": + return spk_audio_queue = Queue() spk_device = [device for device in getOutputDevices() if device["name"] == config.CHOICE_SPEAKER_DEVICE][0] @@ -362,6 +370,9 @@ class Model: self.spk_audio_recorder = None def startCheckSpeakerEnergy(self, fnc): + if config.CHOICE_SPEAKER_DEVICE == "None": + return + def sendSpeakerEnergy(): if speaker_energy_queue.empty() is False: energy = speaker_energy_queue.get()