{"record":{"id":"8244299cf8ded0ba","repo":"NousResearch/hermes-agent","slug":"voice-mode-requires-sounddevice-and-numpy-install","errorCode":null,"errorMessage":"Voice mode requires sounddevice and numpy.\nInstall with: {sys.executable} -m pip install sounddevice numpy","messagePattern":"Voice mode requires sounddevice and numpy\\.\nInstall with: (.+?) -m pip install sounddevice numpy","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"cli.py","lineNumber":12900,"sourceCode":"            return\n        from tools.voice_mode import create_audio_recorder, check_voice_requirements\n\n        reqs = check_voice_requirements()\n        if not reqs[\"audio_available\"]:\n            if _is_termux_environment():\n                details = reqs.get(\"details\", \"\")\n                if \"Termux:API Android app is not installed\" in details:\n                    raise RuntimeError(\n                        \"Termux:API command package detected, but the Android app is missing.\\n\"\n                        \"Install/update the Termux:API Android app, then retry /voice on.\\n\"\n                        \"Fallback: pkg install python-numpy portaudio && python -m pip install sounddevice\"\n                    )\n                raise RuntimeError(\n                    \"Voice mode requires either Termux:API microphone access or Python audio libraries.\\n\"\n                    \"Option 1: pkg install termux-api and install the Termux:API Android app\\n\"\n                    \"Option 2: pkg install python-numpy portaudio && python -m pip install sounddevice\"\n                )\n            raise RuntimeError(\n                \"Voice mode requires sounddevice and numpy.\\n\"\n                f\"Install with: {sys.executable} -m pip install sounddevice numpy\"\n            )\n        if not reqs.get(\"stt_available\", reqs.get(\"stt_key_set\")):\n            raise RuntimeError(\n                \"Voice mode requires an STT provider for transcription.\\n\"\n                \"Option 1: uv pip install faster-whisper  \"\n                \"(free, local; `pip install faster-whisper` also works if pip is on PATH)\\n\"\n                \"Option 2: Set GROQ_API_KEY (free tier)\\n\"\n                \"Option 3: Set VOICE_TOOLS_OPENAI_KEY (paid)\"\n            )\n\n        # Prevent double-start from concurrent threads (atomic check-and-set)\n        with self._voice_lock:\n            if self._voice_recording:\n                return\n            self._voice_recording = True\n","sourceCodeStart":12882,"sourceCodeEnd":12918,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/cli.py#L12882-L12918","documentation":"Raised when voice recording starts on a non-Termux platform and check_voice_requirements() reports audio unavailable — i.e. the Python 'sounddevice' and/or 'numpy' packages needed for microphone capture are missing or unimportable. The message embeds the current interpreter path so the pip install targets the right environment.","triggerScenarios":"Running `/voice on` on desktop Linux/macOS/Windows where sounddevice or numpy is not installed, or is installed into a different Python than the one running Hermes (e.g. system pip vs .venv).","commonSituations":"Fresh install without the optional audio extras; installing with pip while running under a venv (or vice versa); a broken portaudio system library making `import sounddevice` fail even though the wheel is present.","solutions":["Install into the SAME interpreter shown in the message: `<that python> -m pip install sounddevice numpy`","If import still fails, install the system portaudio library (apt install libportaudio2 / brew install portaudio)","Verify with `python -c \"import sounddevice, numpy\"` before retrying `/voice on`"],"exampleFix":"# before\n/voice on  # RuntimeError: Voice mode requires sounddevice and numpy.\n\n# after\nsource .venv/bin/activate\npython -m pip install sounddevice numpy\n/voice on","handlingStrategy":"validation","validationCode":"import importlib.util, sys\n\ndef audio_deps_available() -> bool:\n    return importlib.util.find_spec(\"sounddevice\") is not None and \\\n           importlib.util.find_spec(\"numpy\") is not None\n\nif not audio_deps_available():\n    print(f\"{sys.executable} -m pip install sounddevice numpy\")","typeGuard":null,"tryCatchPattern":"try:\n    cli._voice_start_recording()\nexcept RuntimeError as e:\n    if \"sounddevice and numpy\" in str(e):\n        subprocess.run([sys.executable, \"-m\", \"pip\", \"install\", \"sounddevice\", \"numpy\"])\n    else:\n        raise","preventionTips":["Install sounddevice/numpy into the same venv that runs Hermes","Check `import sounddevice` succeeds — a missing system portaudio fails the import even with the wheel installed","Run the interpreter-qualified install command printed in the error, not bare pip"],"tags":["voice","audio","python","dependencies"],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}