From aa3ca4036eb0fb4f54b7136546154b5ac306514b Mon Sep 17 00:00:00 2001 From: misyaguziya Date: Mon, 9 Oct 2023 00:17:27 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B[bugfix]=20Model=20:=20Device?= =?UTF-8?q?=E3=81=8C=E4=B8=80=E3=81=A4=E3=82=82=E3=81=AA=E3=81=84=E5=A0=B4?= =?UTF-8?q?=E5=90=88=E3=81=AB"NoHost"/"NoDevice"=E3=81=A7=E3=82=BB?= =?UTF-8?q?=E3=83=83=E3=83=88=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model.py | 8 ++++---- models/transcription/transcription_utils.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/model.py b/model.py index 4b371f0b..121bf8d4 100644 --- a/model.py +++ b/model.py @@ -280,7 +280,7 @@ class Model: return False def startMicTranscript(self, fnc): - if config.CHOICE_MIC_HOST == "None" or config.CHOICE_MIC_DEVICE == "None": + if config.CHOICE_MIC_HOST == "NoDevice" or config.CHOICE_MIC_DEVICE == "NoDevice": return mic_audio_queue = Queue() @@ -324,7 +324,7 @@ class Model: self.mic_audio_recorder = None def startCheckMicEnergy(self, fnc): - if config.CHOICE_MIC_HOST == "None" or config.CHOICE_MIC_DEVICE == "None": + if config.CHOICE_MIC_HOST == "NoDevice" or config.CHOICE_MIC_DEVICE == "NoDevice": return def sendMicEnergy(): @@ -353,7 +353,7 @@ class Model: self.mic_energy_recorder = None def startSpeakerTranscript(self, fnc): - if config.CHOICE_SPEAKER_DEVICE == "None": + if config.CHOICE_SPEAKER_DEVICE == "NoDevice": return spk_audio_queue = Queue() spk_device = [device for device in getOutputDevices() if device["name"] == config.CHOICE_SPEAKER_DEVICE][0] @@ -397,7 +397,7 @@ class Model: self.spk_audio_recorder = None def startCheckSpeakerEnergy(self, fnc): - if config.CHOICE_SPEAKER_DEVICE == "None": + if config.CHOICE_SPEAKER_DEVICE == "NoDevice": return def sendSpeakerEnergy(): diff --git a/models/transcription/transcription_utils.py b/models/transcription/transcription_utils.py index 522cb7a2..fead4fc4 100644 --- a/models/transcription/transcription_utils.py +++ b/models/transcription/transcription_utils.py @@ -13,7 +13,7 @@ def getInputDevices(): else: devices[host["name"]] = [device] if len(devices) == 0: - devices = {"None": [{"name": "None"}]} + devices = {"NoHost": [{"name": "NoDevice"}]} return devices def getOutputDevices(): @@ -24,7 +24,7 @@ def getOutputDevices(): if device["hostApi"] == wasapi_info["index"] and device["isLoopbackDevice"] is True: devices.append(device) if len(devices) == 0: - devices = [{'name':"None"}] + devices = [{'name':"NoDevice"}] return devices def getDefaultInputDevice(): @@ -38,7 +38,7 @@ def getDefaultInputDevice(): device = p.get_device_info_by_host_api_device_index(host_index, device_index) if device["index"] == defaultInputDevice: return {"host": host, "device": device} - return {"host": {"name": "None"}, "device": {"name": "None"}} + return {"host": {"name": "NoHost"}, "device": {"name": "NoDevice"}} def getDefaultOutputDevice(): with PyAudio() as p: @@ -55,4 +55,4 @@ def getDefaultOutputDevice(): if default_speakers["name"] in loopback["name"]: default_device = loopback return default_device - return {"name":"None"} \ No newline at end of file + return {"name":"NoDevice"} \ No newline at end of file