


























@@ -1172,6 +1172,7 @@ Auto-join example:
11721172 discord: {
11731173 voice: {
11741174 enabled: true,
1175+ mode: "stt-tts",
11751176 model: "openai/gpt-5.4-mini",
11761177 autoJoin: [
11771178 {
@@ -1199,8 +1200,10 @@ Auto-join example:
11991200Notes:
1200120112011202- `voice.tts` overrides `messages.tts` for voice playback only.
1202-- `voice.model` overrides the LLM used for Discord voice channel responses only. Leave it unset to inherit the routed agent model. Do not set this to `gpt-realtime-2`; Discord voice channels use STT plus TTS playback, not the OpenAI Realtime session transport.
1203-- STT uses `tools.media.audio`; `voice.model` does not affect transcription.
1203+- `voice.mode` controls the conversation path: `stt-tts` keeps the existing batch STT plus TTS flow, `talk-buffer` uses a realtime voice shell for turn timing/transcription/playback while the OpenClaw agent produces the answer, and `bidi` lets the realtime model converse directly while exposing `openclaw_agent_consult` for the OpenClaw brain.
1204+- `voice.model` overrides the OpenClaw agent brain for Discord voice responses and realtime consults. Leave it unset to inherit the routed agent model. It is separate from `voice.realtime.model`.
1205+- In `stt-tts` mode, STT uses `tools.media.audio`; `voice.model` does not affect transcription.
1206+- In realtime modes, `voice.realtime.provider`, `voice.realtime.model`, and `voice.realtime.voice` configure the realtime audio session. For OpenAI Realtime 2 plus the Codex brain, use `voice.realtime.model: "gpt-realtime-2"` and `voice.model: "openai-codex/gpt-5.5"`.
12041207- For an OpenAI voice on Discord playback, set `voice.tts.provider: "openai"` and choose a Text-to-speech voice under `voice.tts.openai.voice` or `voice.tts.providers.openai.voice`. `cedar` is a good masculine-sounding choice on the current OpenAI TTS model.
12051208- Per-channel Discord `systemPrompt` overrides apply to voice transcript turns for that voice channel.
12061209- Voice transcript turns derive owner status from Discord `allowFrom` (or `dm.allowFrom`); non-owner speakers cannot access owner-only tools (for example `gateway` and `cron`).
@@ -1211,23 +1214,67 @@ Notes:
12111214- `@discordjs/voice` defaults are `daveEncryption=true` and `decryptionFailureTolerance=24` if unset.
12121215- `voice.connectTimeoutMs` controls the initial `@discordjs/voice` Ready wait for `/vc join` and auto-join attempts. Default: `30000`.
12131216- `voice.reconnectGraceMs` controls how long OpenClaw waits for a disconnected voice session to begin reconnecting before destroying it. Default: `15000`.
1214-- Voice playback does not stop just because another user starts speaking. To avoid feedback loops, OpenClaw ignores new voice capture while TTS is playing; speak after playback finishes for the next turn.
1217+- In `stt-tts` mode, voice playback does not stop just because another user starts speaking. To avoid feedback loops, OpenClaw ignores new voice capture while TTS is playing; speak after playback finishes for the next turn. Realtime modes forward speaker starts as barge-in signals to the realtime provider.
12151218- `voice.captureSilenceGraceMs` controls how long OpenClaw waits after Discord reports a speaker has stopped before finalizing that audio segment for STT. Default: `2500`; raise this if Discord splits normal pauses into choppy partial transcripts.
12161219- When ElevenLabs is the selected TTS provider, Discord voice playback uses streaming TTS and starts from the provider response stream. Providers without streaming support fall back to the synthesized temp-file path.
12171220- OpenClaw also watches receive decrypt failures and auto-recovers by leaving/rejoining the voice channel after repeated failures in a short window.
12181221- If receive logs repeatedly show `DecryptionFailed(UnencryptedWhenPassthroughDisabled)` after updating, collect a dependency report and logs. The bundled `@discordjs/voice` line includes the upstream padding fix from discord.js PR #11449, which closed discord.js issue #11419.
12191222- `The operation was aborted` receive events are expected when OpenClaw finalizes a captured speaker segment; they are verbose diagnostics, not warnings.
12201223- Verbose Discord voice logs include a bounded one-line STT transcript preview for each accepted speaker segment, so debugging shows both the user side and the agent reply side without dumping unbounded transcript text.
122112241222-Voice channel pipeline:
1225+STT plus TTS pipeline:
1223122612241227- Discord PCM capture is converted to a WAV temp file.
12251228- `tools.media.audio` handles STT, for example `openai/gpt-4o-mini-transcribe`.
12261229- The transcript is sent through Discord ingress and routing while the response LLM runs with a voice-output policy that hides the agent `tts` tool and asks for returned text, because Discord voice owns final TTS playback.
12271230- `voice.model`, when set, overrides only the response LLM for this voice-channel turn.
12281231- `voice.tts` is merged over `messages.tts`; streaming-capable providers feed the player directly, otherwise the resulting audio file is played in the joined channel.
122912321230-Credentials are resolved per component: LLM route auth for `voice.model`, STT auth for `tools.media.audio`, and TTS auth for `messages.tts`/`voice.tts`.
1233+Realtime talk-buffer example:
1234+1235+```json5
1236+{
1237+ channels: {
1238+ discord: {
1239+ voice: {
1240+ enabled: true,
1241+ mode: "talk-buffer",
1242+ model: "openai-codex/gpt-5.5",
1243+ realtime: {
1244+ provider: "openai",
1245+ model: "gpt-realtime-2",
1246+ voice: "cedar",
1247+ },
1248+ },
1249+ },
1250+ },
1251+}
1252+```
1253+1254+Realtime bidi example:
1255+1256+```json5
1257+{
1258+ channels: {
1259+ discord: {
1260+ voice: {
1261+ enabled: true,
1262+ mode: "bidi",
1263+ model: "openai-codex/gpt-5.5",
1264+ realtime: {
1265+ provider: "openai",
1266+ model: "gpt-realtime-2",
1267+ voice: "cedar",
1268+ toolPolicy: "safe-read-only",
1269+ consultPolicy: "always",
1270+ },
1271+ },
1272+ },
1273+ },
1274+}
1275+```
1276+1277+Credentials are resolved per component: LLM route auth for `voice.model`, STT auth for `tools.media.audio`, TTS auth for `messages.tts`/`voice.tts`, and realtime provider auth for `voice.realtime.providers` or the provider's normal auth config.
1231127812321279### Voice messages
12331280此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。