From b76b8ca718e38127b6165358fa0e86cb7ff4c75d Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Sun, 12 Oct 2025 17:17:02 -0700 Subject: [PATCH] Update radio.py --- modules/radio.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/radio.py b/modules/radio.py index 00c390e..78927f8 100644 --- a/modules/radio.py +++ b/modules/radio.py @@ -14,16 +14,17 @@ if radio_detection_enabled: if voxDetectionEnabled: voxHoldTime = signalHoldTime - if useLocalVoxModel: - voxModel = Model(lang=localVoxModelPath) # use built in model for specified language - else: - voxModel = Model(lang=voxLanguage) # use auto downloaded model for specified language - try: import sounddevice as sd # pip install sounddevice sudo apt install portaudio19-dev from vosk import Model, KaldiRecognizer # pip install vosk import json q = asyncio.Queue() + + if useLocalVoxModel: + voxModel = Model(lang=localVoxModelPath) # use built in model for specified language + else: + voxModel = Model(lang=voxModelLanguage) # use built in model for specified language + except Exception as e: print(f"RadioMon: Error importing VOX dependencies: {e}") print(f"To use VOX detection please install the vosk and sounddevice python modules")