This page provides a high-level overview of the voice interaction and speech synthesis capabilities of Hermes Agent. The system supports full-duplex voice conversations in the CLI, automated transcription of voice messages on messaging platforms (Telegram, Discord, WhatsApp, Slack, Signal, etc.), and high-quality text-to-speech (TTS) responses across multiple providers.
Hermes Agent bridges the gap between natural language speech and the agentic core through a modular pipeline of Speech-to-Text (STT) and Text-to-Speech (TTS) components.
| Feature | Description | Implementation |
|---|---|---|
| Voice Mode | Real-time, push-to-talk or continuous voice interaction in the CLI and Discord. | tools/voice_mode.py tools/voice_mode.py1-10 |
| STT Pipeline | Multi-provider transcription (Local, Groq, OpenAI, Mistral, xAI, ElevenLabs). | tools/transcription_tools.py tools/transcription_tools.py5-15 |
| TTS Synthesis | Multi-provider synthesis (Edge, ElevenLabs, OpenAI, MiniMax, Mistral, Gemini, xAI, NeuTTS, KittenTTS, Piper). | tools/tts_tool.py tools/tts_tool.py5-15 |
| Platform Delivery | Integration with Discord Voice Channels and messaging voice bubbles. | `website/docs/user-guide/features/tts.md:32-40]() |
The following diagram illustrates how audio data flows from a user into the AIAgent and back out as synthesized speech, bridging the "Natural Language Space" to the "Code Entity Space".
Audio Processing Pipeline
Sources: tools/voice_mode.py1-10 tools/transcription_tools.py23-28 tools/tts_tool.py32-35
Voice Mode allows for a hands-free interaction experience within the terminal and integrated messaging platforms. It utilizes sounddevice and numpy for low-latency audio I/O and implements environment detection to ensure compatibility across SSH, Docker, and WSL tools/voice_mode.py141-190
/voice on in the CLI. The system uses a _voice_lock to protect state changes during concurrent recording and processing.termux-microphone-record and termux-api when PortAudio is unavailable tools/voice_mode.py61-85pulse/native or pipewire-0) to allow audio forwarding over remote connections tools/voice_mode.py89-139discord.py[voice] and PyNaCl for encryption and Opus bindings.For details, see Voice Mode.
Sources: tools/voice_mode.py1-10 tools/voice_mode.py141-190 tools/voice_mode.py89-139
The TTS and STT systems are designed for "Zero Config" operation while supporting premium cloud providers for enhanced quality.
The transcription system resolves providers in a priority chain: Local (faster-whisper) > Groq > OpenAI > Mistral > xAI > ElevenLabs tools/transcription_tools.py86-93
faster-whisper to run models locally or executes a shell command defined in HERMES_LOCAL_STT_COMMAND tools/transcription_tools.py94-95get_env_value() to ensure keys in ~/.hermes/.env are honored tools/transcription_tools.py51-63The text_to_speech_tool handles synthesis and automatic conversion. It utilizes ffmpeg to convert various outputs to OGG Opus format specifically for Telegram voice bubbles tools/tts_tool.py24-26
TTS Provider Mapping
| Provider | Code Entity | Key Features |
|---|---|---|
| Edge TTS | _import_edge_tts | Free, Microsoft Edge neural voices tools/tts_tool.py86-96 |
| ElevenLabs | _import_elevenlabs | Premium quality, model-aware character caps tools/tts_tool.py98-118 |
| OpenAI | _import_openai_client | High quality, gpt-4o-mini-tts support tools/tts_tool.py119-122 |
| MiniMax TTS | DEFAULT_MINIMAX_MODEL | High-quality with voice cloning tools/tts_tool.py179-181 |
| Mistral | _import_mistral_client | Multilingual, native Opus support tools/tts_tool.py124-141 |
| Google Gemini | DEFAULT_GEMINI_TTS_MODEL | 30 prebuilt voices, persona prompt support website/docs/user-guide/features/tts.md68-72 |
| xAI TTS | DEFAULT_XAI_VOICE_ID | Grok voices, uses xAI Grok OAuth tools/tts_tool.py184-186 |
| NeuTTS | DEFAULT_PROVIDER | Local, free, on-device TTS tools/tts_tool.py13 |
| KittenTTS | _import_kittentts | On-device 25MB nano model tools/tts_tool.py148-151 |
| Piper | _import_piper | Local neural VITS, 44 languages tools/tts_tool.py154-163 |
Voice/TTS Class Association
Sources: tools/transcription_tools.py23-28 tools/tts_tool.py5-15 tools/voice_mode.py32-50
The voice and xAI systems overlap in multimodal capabilities. The resolve_xai_http_credentials helper ensures unified authentication for both TTS and multimodal generation. Additionally, the system manages the persistence of generated media (such as audio or video files) on xAI's infrastructure with configurable expiry.
For details, see TTS and Transcription.
Sources: tools/tts_tool.py5-16 tools/transcription_tools.py5-16 tools/voice_mode.py1-10 tools/transcription_tools.py51-63
Refresh this wiki
This wiki was recently refreshed. Please wait 4 days to refresh again.