Voice Summary and Speech Recognition
botmux voice works in two directions. Turn on either one, or both:
Both are optional advanced features, off by default. Run botmux restart after configuring them.
Voice summary: turn a reply into audio with one tap
Once a voice engine is configured, the bot's reply cards get a "🔊 语音总结" (Voice Summary) button at the bottom. Tap it and:
- The bot condenses its previous reply into at most 5 spoken sentences. It keeps only the conclusions and drops code, commands, paths, links, and anything else that doesn't read aloud well.
- It synthesizes a Lark voice message and sends it back to the current session.
What you hear is a plain-speech summary, not the original text read word for word.
Things to know:
- Only when you ask: replies don't get voice clips automatically.
- One voice clip per card: repeated taps, or several people tapping, still produce a single clip. No flooding.
- Wait until the session is idle: tapping while the AI is still working shows "The session is still running". Try again once it stops. An offline session can't generate one either.
- Permission gate: only members allowed to use this bot can tap it. Others see a "not authorized to use this bot" prompt.
- No engine, no button. Broadcast messages the AI sends to the group top level with
--top-leveldon't carry the button either.
Step 1: Pick a voice engine
Run botmux voice, choose an engine, and paste your credentials. The config is written to the voice block of the global ~/.botmux/config.json. This command is deliberately kept separate from botmux setup.
The wizard also asks for a voice and a speech-rate multiplier. Press Enter to keep the defaults.
SAMI (ByteDance internal)
- On the company Speech Capability Platform, apply for "Speech Synthesis (large model)". botmux only synthesizes, so you don't need speech recognition.
- You get three items: appkey, AccessKey, and SecretKey. If you see "Namespace not enabled" or "no route", ask the Speech team through internal Oncall to enable it.
- Run
botmux voice, select[1], and paste accessKey / secretKey / appkey in turn.
The service endpoint is built in, so you normally don't fill it in (the wizard asks whether to customize endpoints; press Enter to skip). The SecretKey is only used locally to sign a request for a temporary token. It is never sent out.
OpenAI-compatible
Works with OpenAI or a self-hosted service (such as Kokoro-FastAPI or openedai-speech). Prepare three items:
- baseUrl: the service address. OpenAI is
https://api.openai.com/v1. For self-hosted, use your own, e.g.http://127.0.0.1:8880/v1. - model: the model name. OpenAI uses
tts-1. For self-hosted, follow its docs (e.g.kokoro). - apiKey: the service key. Leave it empty if your self-hosted service has no auth.
Run botmux voice, select [2], and fill in the prompts. The voice defaults to alloy; for self-hosted, use a voice your service supports.
MiniMax (Hailuo speech)
- Enable text-to-audio (T2A) on the MiniMax open platform and get an API key.
- Run
botmux voice, select[3], paste the API key, then pick a region:[1]Globalapi.minimax.io(default)[2]Chinaapi.minimaxi.com
The key and region must match. A China account on the Global region (or the reverse) fails authentication. The model defaults to speech-2.8-hd. If the default voice isn't available on your account, use a system voice id listed in the MiniMax console.
Volcengine / Doubao V3
- Run
botmux voiceand select[4]. - Choose a mode (required, no default):
standard: a regular pay-as-you-go accountagent-plan: a dedicated Ark Agent Plan account
- Paste the API key for that mode.
The rate defaults to 1 and is clamped to 0.5–2 in the request. See "Volcengine advanced notes" at the end for key inheritance, endpoints, and other details.
Step 2: Install the Opus encoder
Lark voice messages use Opus, so synthesized audio is converted with the system's opus-tools (which provides opusenc). botmux voice checks for it when saving and offers to install it if missing. You can also install it yourself:
Step 3: Restart
Reply cards now show the "🔊 语音总结" button at the bottom.
Speech recognition: send voice to the bot
Once enabled, send the bot a Lark voice message (in a group or inside a topic) and botmux will:
- Reply with "🎤 正在转写语音…" (transcribing);
- Download the audio and transcribe it with the service you configured;
- Delete the placeholder and hand the text to the AI, prefixed with "🎤 语音转写:" (voice transcript). It is handled just like a typed instruction. Works for new topics and for follow-ups inside a topic.
If transcription fails (download error, service error, timeout, or an empty result), the bot replies with the reason. The voice message is not passed to the AI, and no empty session is created.
If speech recognition isn't configured, sending a voice message gets a "speech recognition not configured" reply instead. It is not passed to the AI either.
Configure
Speech recognition uses the OpenAI-compatible /audio/transcriptions endpoint (Whisper API format). It works with OpenAI or a self-hosted whisper.cpp server, faster-whisper, and similar.
Speech recognition and voice summary are independent. You can set up recognition without a voice engine.
Management commands
Note that botmux voice disable deletes the entire global voice block, including the speech recognition config. To turn off recognition only, use botmux voice asr disable. In the other direction, re-running botmux voice to change engines keeps your existing speech recognition config.
All changes need botmux restart to take effect.
Config file reference
You can also edit the voice block of ~/.botmux/config.json directly:
Common fields:
Per-bot configuration
Put a voice block with the same structure inside a bot object in bots.json. It overlays the global config field by field. Bots can share one global config, each have their own, or just change the voice or rate. The asr block can be overridden per bot too, but include "enabled": true in the bot's own asr block. Without it, speech recognition is turned off for that bot.
For example, to switch one bot to a Volcengine Agent Plan account:
Volcengine advanced notes
- Set both
engineandmodeexplicitly. A missing or invalid mode makes the config unusable (no button). It never silently falls back to another billed endpoint. - Both modes use the fixed host
openspeech.bytedance.comand resourceseed-tts-2.0:standarduses/api/v3/tts/unidirectional,agent-planuses/api/v3/plan/tts/unidirectional. Chat API URLs and legacy app IDs are not supported. - Replace the
<...>placeholders with real keys. botmux does not read environment variables with those names. - Key inheritance for per-bot overrides:
- Same mode as global: you can omit the key and inherit it, or override just
speakerorrate. - Different mode: you must provide a new key. A key from the other mode is never inherited.
"volcengine": nullor an empty key: do not inherit the global account.
- Same mode as global: you can omit the key and inherit it, or override just
botmux voice statusonly shows whether a key is set, never its value.- Audio is sent after the full response arrives; playback is not streamed. The default timeout is 60 seconds. Failed requests are not retried, redirects are not followed, and endpoints are not switched. Incomplete data or oversized responses fail with an error instead of sending partial audio. Billing is determined by the provider.
