mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-18 04:41:56 +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:
parent
e71393237e
commit
081f9368bc
1 changed files with 3 additions and 1 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue