Doubao Realtime
Doubao/Volcengine Realtime Dialogue voice provider for OpenClaw Talk mode.
Install
openclaw plugins install clawhub:openclaw-doubao-realtimeOpenClaw Doubao Realtime
Doubao/Volcengine Realtime Dialogue voice provider for OpenClaw Talk mode.
This code plugin registers the realtime voice provider doubao-realtime for OpenClaw gateway-relay sessions. It is provider-only: it does not include call-card routes, bot delivery, Mini App assets, or phone network setup.
Requirements
- OpenClaw Gateway
>=2026.6.8 - A Volcengine/Doubao Realtime Dialogue app id, access key, and app key
- A Realtime Dialogue model and speaker that belong to compatible Volcengine products
- Android or iOS OpenClaw Talk configured for
gateway-relay
Install
openclaw plugins install clawhub:openclaw-doubao-realtime
For local development, load this checkout as an OpenClaw code plugin and keep index.js, openclaw.plugin.json, src/, patches/, and this README in the package surface.
Configure
Environment variables:
export VOLCENGINE_REALTIME_APP_ID="<volcengine-app-id>"
export VOLCENGINE_REALTIME_ACCESS_KEY="<volcengine-access-key>"
export VOLCENGINE_REALTIME_APP_KEY="<volcengine-app-key>"
export VOLCENGINE_REALTIME_SPEAKER="<speaker-id>"
export VOLCENGINE_REALTIME_MODEL="1.2.1.1"
Equivalent openclaw.json shape:
{
"plugins": {
"entries": {
"doubao-realtime": {
"enabled": true,
"config": {
"appId": "<volcengine-app-id>",
"accessKey": "<volcengine-access-key>",
"appKey": "<volcengine-app-key>",
"speaker": "<speaker-id>",
"model": "1.2.1.1"
}
}
}
},
"talk": {
"realtime": {
"provider": "doubao-realtime",
"transport": "gateway-relay"
}
}
}
Recognized provider config keys:
| Key | Env | Default | Notes |
|---|---|---|---|
appId | VOLCENGINE_REALTIME_APP_ID | none | Required Doubao app id. |
accessKey, apiKey | VOLCENGINE_REALTIME_ACCESS_KEY, VOLCENGINE_REALTIME_API_KEY | none | Required access key. |
appKey | VOLCENGINE_REALTIME_APP_KEY | none | Required Doubao Realtime API app key. |
resourceId | VOLCENGINE_REALTIME_RESOURCE_ID | volc.speech.dialog | Realtime Dialogue resource id. |
url | VOLCENGINE_REALTIME_URL | wss://openspeech.bytedance.com/api/v3/realtime/dialogue | WebSocket endpoint. |
model | VOLCENGINE_REALTIME_MODEL | 1.2.1.1 | Realtime Dialogue model id. |
speaker, voice | VOLCENGINE_REALTIME_SPEAKER | zh_female_vv_jupiter_bigtts | Realtime speaker id. |
asrEndSmoothWindowMs | VOLCENGINE_REALTIME_ASR_END_SMOOTH_WINDOW_MS | 500 | Doubao ASR endpointing window, valid range 500-50000 ms. |
tts2Model | VOLCENGINE_REALTIME_TTS_2_0_MODEL | inferred for O2 clone voices | Sends tts.extra.tts_2.0_model. |
speechRate | none | provider default | Optional Doubao speech rate. |
loudnessRate | none | provider default | Optional Doubao loudness rate. |
Optional emotion tagging can use DashScope Qwen3-ASR-Flash as a sidecar:
export DASHSCOPE_EMOTION_TAGGING_ENABLED="true"
export DASHSCOPE_API_KEY="<dashscope-api-key>"
export DASHSCOPE_API_BASE_URL="https://dashscope.aliyuncs.com"
The sidecar does not sit in front of audio, ASR, or Talk response flow. It only adds a short emotion tag to the OpenClaw consult context when a background result is ready.
Native Picker Support
The plugin works on unpatched OpenClaw through explicit talk.realtime config. Provider-owned model and voice pickers require an OpenClaw core version that includes the realtime catalog patch saved in this repository as patches/openclaw-realtime-provider-catalog.patch.
Without that core patch, set Doubao model and speaker values manually in config. Clone voices such as S_... ids are intentionally accepted as free-form voice or speaker values instead of being published as global choices.
Release Checklist
Before publishing to ClawHub:
npm test
npm pack --dry-run
clawhub package validate .
clawhub package publish . --dry-run \
--source-repo <owner/repo> \
--source-commit "$(git rev-parse HEAD)"
If the checkout already has a GitHub remote that ClawHub can detect, the explicit --source-repo and --source-commit flags are not needed.
The package is intentionally provider-only. It publishes the plugin runtime plus the optional OpenClaw core patch artifact; it does not vendor or fork OpenClaw core.
How It Works
- OpenClaw Talk creates a realtime
gateway-relaysession with providerdoubao-realtime. - The provider declares the OpenClaw audio contract as PCM16 mono 24 kHz.
- User audio is resampled and chunked for Doubao 16 kHz ASR input.
- Doubao ASR final text is surfaced as the
openclaw_agent_consulttool call when direct provider responses are disabled. - OpenClaw agent text streams back to Doubao TTS with token-level
ChatTTSTextchunks. - Doubao TTS audio returns as PCM16 mono 24 kHz for Talk playback.
- Barge-in uses the provider bridge cancellation path to clear active output when the user speaks over playback.
The provider sends a generic OpenClaw Talk consult context: 来自 OpenClaw Talk 实时语音。
Android And iOS Talk Acceptance
Use this checklist before publishing or promoting the plugin:
- Install or load the plugin in OpenClaw.
- Configure Talk realtime provider
doubao-realtimewithtransport: "gateway-relay". - Start Android Talk and verify the session connects.
- Speak and verify assistant audio is audible.
- Speak while assistant audio is playing and verify output is interrupted.
- Repeat the same connect, hear, and interrupt checks on iOS Talk.
Decoupling
Telegram Mini App and Tailscale Serve are not required by this provider. They belong in a separate companion plugin, which can talk to OpenClaw through Gateway Talk gateway-relay and select providerId: "doubao-realtime" like any other Talk client.
Diagnostics
Run provider tests:
npm test
Useful Gateway log filters:
journalctl --user -u openclaw-gateway.service --since '10 min ago' | rg 'doubao|realtime|talk.session|asr|tts|InvalidSpeaker'
If Doubao returns InvalidSpeaker or a resource mismatch, first check that the configured model, speaker, and resourceId belong to the same Volcengine product family. Public BigTTS voices ending in _uranus_bigtts usually belong to O2.0 realtime model 1.2.1.1; other voice families may require a different model or resource.
Security
- Volcengine and DashScope credentials stay server-side in environment variables or OpenClaw plugin config.
- Clients do not receive Volcengine access keys, app keys, Gateway tokens, or DashScope keys.
- Do not commit
.envfiles or local credential-bearing config.
License
MIT
