





















@@ -1201,9 +1201,11 @@ Notes:
1201120112021202- `voice.tts` overrides `messages.tts` for voice playback only.
12031203- `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.agentSession` controls which OpenClaw conversation receives voice turns. Leave it unset for the voice channel's own session, or set `{ mode: "target", target: "channel:<text-channel-id>" }` to make the voice channel act as the microphone/speaker extension of an existing Discord text channel session such as `#maintainers`.
12041205- `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`.
12051206- In `stt-tts` mode, STT uses `tools.media.audio`; `voice.model` does not affect transcription.
12061207- 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"`.
1208+- `voice.realtime.bargeIn` controls whether Discord speaker-start events interrupt active realtime playback. If unset, it follows the realtime provider's input-audio interruption setting.
12071209- 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.
12081210- Per-channel Discord `systemPrompt` overrides apply to voice transcript turns for that voice channel.
12091211- 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`).
@@ -1215,6 +1217,7 @@ Notes:
12151217- `voice.connectTimeoutMs` controls the initial `@discordjs/voice` Ready wait for `/vc join` and auto-join attempts. Default: `30000`.
12161218- `voice.reconnectGraceMs` controls how long OpenClaw waits for a disconnected voice session to begin reconnecting before destroying it. Default: `15000`.
12171219- 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.
1220+- In realtime modes, echo from speakers into an open mic can look like barge-in and interrupt playback. For echo-heavy Discord rooms, set `voice.realtime.providers.openai.interruptResponseOnInputAudio: false` to keep OpenAI from auto-interrupting on input audio. Add `voice.realtime.bargeIn: true` if you still want Discord speaker-start events to interrupt active playback.
12181221- `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.
12191222- 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.
12201223- OpenClaw also watches receive decrypt failures and auto-recovers by leaving/rejoining the voice channel after repeated failures in a short window.
@@ -1230,6 +1233,24 @@ STT plus TTS pipeline:
12301233- `voice.model`, when set, overrides only the response LLM for this voice-channel turn.
12311234- `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.
123212351236+Default voice-channel session example:
1237+1238+```json5
1239+{
1240+ channels: {
1241+ discord: {
1242+ voice: {
1243+ enabled: true,
1244+ mode: "stt-tts",
1245+ model: "openai/gpt-5.4-mini",
1246+ },
1247+ },
1248+ },
1249+}
1250+```
1251+1252+With no `voice.agentSession` block, each voice channel gets its own routed OpenClaw session. For example, `/vc join channel:234567890123456789` talks to the session for that Discord voice channel.
1253+12331254Realtime talk-buffer example:
1234125512351256```json5
@@ -1274,6 +1295,79 @@ Realtime bidi example:
12741295}
12751296```
127612971298+Voice as an extension of an existing Discord channel session:
1299+1300+```json5
1301+{
1302+ channels: {
1303+ discord: {
1304+ voice: {
1305+ enabled: true,
1306+ mode: "bidi",
1307+ model: "openai-codex/gpt-5.5",
1308+ agentSession: {
1309+ mode: "target",
1310+ target: "channel:123456789012345678",
1311+ },
1312+ realtime: {
1313+ provider: "openai",
1314+ model: "gpt-realtime-2",
1315+ voice: "cedar",
1316+ toolPolicy: "safe-read-only",
1317+ consultPolicy: "always",
1318+ },
1319+ },
1320+ },
1321+ },
1322+}
1323+```
1324+1325+In this mode the bot joins the configured voice channel, but OpenClaw agent turns use the target channel's normal routed session and agent. The realtime voice session speaks the returned result back into the voice channel. The supervisor agent can still use normal message tools according to its tool policy, including sending a separate Discord message if that is the right action.
1326+1327+Useful target forms:
1328+1329+- `target: "channel:123456789012345678"` routes through a Discord text channel session.
1330+- `target: "123456789012345678"` is treated as a channel target.
1331+- `target: "dm:123456789012345678"` or `target: "user:123456789012345678"` routes through that direct-message session.
1332+1333+Echo-heavy OpenAI Realtime example:
1334+1335+```json5
1336+{
1337+ channels: {
1338+ discord: {
1339+ voice: {
1340+ enabled: true,
1341+ mode: "bidi",
1342+ model: "openai-codex/gpt-5.5",
1343+ realtime: {
1344+ provider: "openai",
1345+ model: "gpt-realtime-2",
1346+ voice: "cedar",
1347+ bargeIn: true,
1348+ consultPolicy: "always",
1349+ providers: {
1350+ openai: {
1351+ interruptResponseOnInputAudio: false,
1352+ },
1353+ },
1354+ },
1355+ },
1356+ },
1357+ },
1358+}
1359+```
1360+1361+Use this when the model hears its own Discord playback through an open mic, but you still want to interrupt it by speaking. OpenClaw keeps OpenAI from auto-interrupting on raw input audio, while `bargeIn: true` lets Discord speaker-start events cancel active playback and start the next captured turn.
1362+1363+Expected voice logs:
1364+1365+- On join: `discord voice: joining ... voiceSession=... supervisorSession=... agentSessionMode=... voiceModel=... realtimeModel=...`
1366+- On realtime start: `discord voice: realtime bridge starting ... interruptResponse=false bargeIn=true`
1367+- On realtime consult: `discord voice: realtime consult requested ... voiceSession=... supervisorSession=... question=...`
1368+- On agent answer: `discord voice: agent turn answer ...`
1369+- On disabled barge-in: `discord voice: realtime capture ignored during playback (barge-in disabled) ...`
1370+12771371Credentials 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.
1278137212791373### Voice messages
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。