mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-21 03:39:54 +00:00
fix(voice_mode): detect audio in WSL when sd.query_devices() returns empty list but PULSE_SERVER is set
In WSL2, sounddevice.query_devices() returns [] even when the PulseAudio bridge is functional. The existing code already handled the case where the query itself raises an exception, but it missed the empty-list case. This change treats an empty device list as non-fatal in WSL when PULSE_SERVER is configured, matching the existing exception-handler behavior. Fixes: WSL users seeing 'No audio input/output devices detected' even though paplay/arecord work fine.
This commit is contained in:
+3
-1
@@ -130,7 +130,9 @@ def detect_audio_environment() -> dict:
|
||||
try:
|
||||
devices = sd.query_devices()
|
||||
if not devices:
|
||||
if termux_capture:
|
||||
if os.environ.get('PULSE_SERVER'):
|
||||
notices.append("No PortAudio devices detected but PULSE_SERVER is set -- continuing")
|
||||
elif termux_capture:
|
||||
notices.append("No PortAudio devices detected, but Termux:API microphone capture is available")
|
||||
else:
|
||||
warnings.append("No audio input/output devices detected")
|
||||
|
||||
Reference in New Issue
Block a user