This commit is contained in:
SpudGunMan
2025-10-12 17:13:41 -07:00
parent 717bbccea3
commit d66a9e745b
3 changed files with 18 additions and 6 deletions
+4
View File
@@ -300,6 +300,10 @@ signalCycleLimit = 5
voxDetectionEnabled = False
# description to use in the alert message
voxDescription = VOX
useLocalVoxModel = False
voxLanguage = en-us
voxInputDevice = -1
[fileMon]
filemon_enabled = False
+9 -5
View File
@@ -2,7 +2,7 @@
# detect signal strength and frequency of active channel if appears to be in use send to mesh network
# depends on rigctld running externally as a network service
# also can use VOX detection with a microphone and vosk speech to text to send voice messages to mesh network
# requires vosk and sounddevice python modules
# requires vosk and sounddevice python modules. download from https://alphacephei.com/vosk/models and unpack
# 2024 Kelly Keeton K7MHI
previousVoxState = False
@@ -11,9 +11,14 @@ import asyncio
if radio_detection_enabled:
import socket
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
@@ -193,12 +198,11 @@ def make_vox_callback(loop, q):
except RuntimeError:
pass
return vox_callback
voxInputDevice = None
async def voxMonitor():
global previousVoxState, voxMsgQueue
try:
model = Model(lang="en-us")
model = voxModel
device_info = sd.query_devices(voxInputDevice, 'input')
samplerate = 16000
logger.debug(f"RadioMon: VOX monitor started on device {device_info['name']} with samplerate {samplerate}")
+5 -1
View File
@@ -368,7 +368,11 @@ try:
signalCycleLimit = config['radioMon'].getint('signalCycleLimit', 5) # default 5 cycles, used with SIGNAL_COOLDOWN
voxDetectionEnabled = config['radioMon'].getboolean('voxDetectionEnabled', False) # default VOX detection disabled
voxDescription = config['radioMon'].get('voxDescription', 'VOX') # default VOX detected audio message
useLocalVoxModel = config['radioMon'].getboolean('useLocalVoxModel', False) # default False
localVoxModelPath = config['radioMon'].get('localVoxModelPath', 'no') # default models/vox.tflite
voxLanguage = config['radioMon'].get('voxLanguage', 'en-US') # default en-US
voxInputDevice = config['radioMon'].getint('voxInputDevice', -1) # default -1 use system default input device
# file monitor
file_monitor_enabled = config['fileMon'].getboolean('filemon_enabled', False)
file_monitor_file_path = config['fileMon'].get('file_path', 'alert.txt') # default alert.txt