Voice Summary and Speech Recognition

botmux voice works in two directions. Turn on either one, or both:

What you wantFeatureSetup command
Listen to a long AI reply as audioVoice summary (TTS, text-to-speech)botmux voice
Send a voice message to the bot and have it treated as a text instructionSpeech recognition (ASR, speech-to-text)botmux voice asr

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:

  1. 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.
  2. 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-level don'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.

EngineForWhat you needDefault voice
[1] SAMIByteDance internal usersappkey, AccessKey, SecretKeyzh_female_cancan_mars_bigtts (Cancan)
[2] OpenAI-compatibleOpenAI, or a self-hosted TTS servicebaseUrl, model, optional apiKeyalloy
[3] MiniMaxMiniMax open platform API key holdersAPI key, regionfemale-shaonv
[4] Volcengine / Doubao V3Volcengine speech accountsMode (standard / agent-plan) + that mode's API keyzh_female_vv_uranus_bigtts

The wizard also asks for a voice and a speech-rate multiplier. Press Enter to keep the defaults.

SAMI (ByteDance internal)

  1. On the company Speech Capability Platform, apply for "Speech Synthesis (large model)". botmux only synthesizes, so you don't need speech recognition.
  2. 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.
  3. 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)

  1. Enable text-to-audio (T2A) on the MiniMax open platform and get an API key.
  2. Run botmux voice, select [3], paste the API key, then pick a region:
    • [1] Global api.minimax.io (default)
    • [2] China api.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

  1. Run botmux voice and select [4].
  2. Choose a mode (required, no default):
    • standard: a regular pay-as-you-go account
    • agent-plan: a dedicated Ark Agent Plan account
  3. 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:

# Debian / Ubuntu
sudo apt-get install -y opus-tools
# macOS
brew install opus-tools

Step 3: Restart

botmux 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:

  1. Reply with "🎤 正在转写语音…" (transcribing);
  2. Download the audio and transcribe it with the service you configured;
  3. 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.

botmux voice asr      # Interactive: baseUrl / apiKey / model, optional language hint
botmux restart        # Take effect
ItemNotes
baseUrlRequired, e.g. https://api.openai.com/v1
modelRequired, e.g. whisper-1
apiKeyOptional. Leave empty if your self-hosted service has no auth
Language hintOptional, e.g. zh. Passed to the service

Speech recognition and voice summary are independent. You can set up recognition without a voice engine.

Management commands

botmux voice              # Configure voice summary (interactive)
botmux voice status       # Show voice summary config (credentials masked)
botmux voice disable      # Delete the whole voice block; the button disappears

botmux voice asr          # Configure speech recognition (interactive)
botmux voice asr status   # Show speech recognition config
botmux voice asr disable  # Turn off speech recognition only, keep the rest

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:

// SAMI (ByteDance internal)
{
  "voice": {
    "engine": "sami",
    "speaker": "zh_female_cancan_mars_bigtts",   // Optional, defaults to Cancan
    "sami": { "accessKey": "...", "secretKey": "...", "appkey": "..." }
  }
}

// OpenAI-compatible
{
  "voice": {
    "engine": "openai",
    "speaker": "alloy",                            // Optional
    "openai": { "baseUrl": "https://api.openai.com/v1", "apiKey": "...", "model": "tts-1" }
  }
}

// MiniMax (region: "cn" China / "global" international, defaults to global)
{
  "voice": {
    "engine": "minimax",
    "speaker": "female-shaonv",                   // Optional
    "minimax": { "apiKey": "...", "region": "cn", "model": "speech-2.8-hd" }
  }
}

// Volcengine / Doubao V3 (mode is required: "standard" or "agent-plan")
{
  "voice": {
    "engine": "volcengine",
    "volcengine": { "mode": "standard", "apiKey": "<STANDARD_API_KEY>" },
    "speaker": "zh_female_vv_uranus_bigtts",      // Optional
    "rate": 1                                     // Optional
  }
}

// Speech recognition: can sit in the same voice block as any engine above
{
  "voice": {
    "asr": {
      "enabled": true,                            // Must be true to take effect
      "baseUrl": "https://api.openai.com/v1",
      "apiKey": "...",
      "model": "whisper-1",
      "language": "zh",                           // Optional
      "timeoutMs": 120000                         // Optional, transcription timeout, default 120 s
    }
  }
}

Common fields:

FieldNotes
enginesami / openai / minimax / volcengine
speakerVoice id. Omit to use the engine's default
rateSpeech-rate multiplier, 1 is normal. Each engine clamps it to its own range (0.5–2 for SAMI, MiniMax, and Volcengine; 0.25–4 for OpenAI-compatible)

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:

{
  "voice": {
    "engine": "volcengine",
    "volcengine": {
      "mode": "agent-plan",
      "apiKey": "<AGENT_PLAN_API_KEY>"
    }
  }
}

Volcengine advanced notes

  • Set both engine and mode explicitly. 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.com and resource seed-tts-2.0: standard uses /api/v3/tts/unidirectional, agent-plan uses /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 speaker or rate.
    • Different mode: you must provide a new key. A key from the other mode is never inherited.
    • "volcengine": null or an empty key: do not inherit the global account.
  • botmux voice status only 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.