Voice Mode: Talking to Your Agent
- Enable voice mode for CLI, Telegram/Discord text replies, and live Discord voice channels
- Use push-to-talk correctly, understanding the two-stage silence detection that ends a recording
- Choose appropriate STT and TTS providers based on speed, quality, cost, and whether an API key is required
- Install the correct package extra (voice/messaging/all) and required system dependencies
- Configure Discord-specific requirements: permissions, privileged intents, and DISCORD_ALLOWED_USERS
- Explain streaming TTS, hallucination filtering, and echo prevention as built-in quality safeguards
Where Voice Works
Voice mode spans three distinct environments: the CLI (your local microphone and speakers), Telegram and Discord (where the agent can reply with voice messages), and Discord voice channels specifically, where the agent can actually join a live channel, listen, and speak in real time.
Push-to-Talk in the CLI
Press Ctrl+B to begin recording. Under the hood, Hermes uses a two-stage silence detection algorithm: it first confirms you are actually speaking by checking for audio above an RMS threshold of 200 sustained for at least 0.3 seconds, then ends the recording after 3 seconds of continuous quiet following that. Recording automatically stops and restarts on its own without you pressing anything again -- you only need to press Ctrl+B a second time when you actually want to exit the recording flow entirely.
Messaging Platform Modes
On Telegram and Discord, two always-on behaviors are available: voice_only mode has the bot speak only when it receives a voice message itself, while all mode has it speak in response to every message regardless of how you sent it.
Choosing Speech-to-Text
Choosing Text-to-Speech
A reasonable default if you want zero setup and zero cost: Local STT paired with Edge TTS. Neither requires an API key, and both are good enough for daily use -- reach for the paid options once you specifically want faster turnaround or higher-fidelity speech. If you do want one of the "Key Required: Yes" options, that key comes from signing up directly with that provider -- Groq, OpenAI, Mistral, xAI, or ElevenLabs each have their own account and dashboard where you generate it; none of it happens inside Hermes.
Installing
Choose the package extra matching what you actually need:
pip install "hermes-agent[voice]" # CLI voice only
pip install "hermes-agent[messaging]" # Discord/Telegram voice
pip install "hermes-agent[all]" # Everything
System dependencies you will also need: PortAudio (microphone and playback), ffmpeg (audio format conversion), the Opus codec (required specifically for Discord voice channels), and espeak-ng (only needed if you are using local TTS).
Discord Voice Channel Setup
Beyond the package install, a Discord voice channel bot needs: Connect and Speak permissions on the bot account, all three privileged intents enabled in the Discord developer portal (Presence, Server Members, and Message Content), and the Opus codec installed as mentioned above.
Quality-of-Life Features
- Streaming TTS -- the agent speaks its response sentence-by-sentence as it is generated, rather than waiting for the entire response to finish before saying anything.
- Hallucination filtering -- Whisper-based transcription occasionally invents phantom words during silence. Hermes filters out 26+ known phantom phrases and matching patterns automatically.
- Echo prevention -- the bot pauses its own audio listening while it is playing back a reply, so it does not pick up and transcribe its own voice.
- Access control -- on Discord specifically, only users listed in
DISCORD_ALLOWED_USERScan trigger voice interactions, separate from the general gateway allowlist from Lesson 5.
Recording sensitivity (silence threshold, duration) and the push-to-talk key itself are all customizable in config.yaml if the defaults do not suit your environment.
The next lesson moves from voice to a different kind of capability: letting your agent actually navigate and interact with web pages.
- Local STT + Edge TTS requires zero API keys and zero cost -- a reasonable default before reaching for paid providers
- Push-to-talk uses two-stage silence detection (RMS threshold 200 for 0.3s confirms speech, 3s continuous quiet ends it) -- you only press Ctrl+B again to exit, not to stop each recording
- Hallucination filtering catches 26+ known Whisper phantom phrases -- a real, documented failure mode of speech-to-text during silence, not a hypothetical edge case
- Discord voice requires all three privileged intents (Presence, Server Members, Message Content) plus Connect+Speak permissions and the Opus codec -- missing any one of these will silently break voice channel functionality
- DISCORD_ALLOWED_USERS is a separate, voice-specific access control from the general gateway allowlist covered in Lesson 5