Doubao Realtime

^L%2x$8@5r7w9

Doubao/Volcengine Realtime Dialogue voice provider for OpenClaw Talk mode.

Capabilities

Realtime voiceSupport live voice conversations.

Readme

OpenClaw 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

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

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

json
{
  "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:

KeyEnvDefaultNotes
appIdVOLCENGINE_REALTIME_APP_IDnoneRequired Doubao app id.
accessKey, apiKeyVOLCENGINE_REALTIME_ACCESS_KEY, VOLCENGINE_REALTIME_API_KEYnoneRequired access key.
appKeyVOLCENGINE_REALTIME_APP_KEYnoneRequired Doubao Realtime API app key.
resourceIdVOLCENGINE_REALTIME_RESOURCE_IDvolc.speech.dialogRealtime Dialogue resource id.
urlVOLCENGINE_REALTIME_URLwss://openspeech.bytedance.com/api/v3/realtime/dialogueWebSocket endpoint.
modelVOLCENGINE_REALTIME_MODEL1.2.1.1Realtime Dialogue model id.
speaker, voiceVOLCENGINE_REALTIME_SPEAKERzh_female_vv_jupiter_bigttsRealtime speaker id.
asrEndSmoothWindowMsVOLCENGINE_REALTIME_ASR_END_SMOOTH_WINDOW_MS500Doubao ASR endpointing window, valid range 500-50000 ms.
tts2ModelVOLCENGINE_REALTIME_TTS_2_0_MODELinferred for O2 clone voicesSends tts.extra.tts_2.0_model.
speechRatenoneprovider defaultOptional Doubao speech rate.
loudnessRatenoneprovider defaultOptional Doubao loudness rate.

Optional emotion tagging can use DashScope Qwen3-ASR-Flash as a sidecar:

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

sh
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-relay session with provider doubao-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_consult tool call when direct provider responses are disabled.
  • OpenClaw agent text streams back to Doubao TTS with token-level ChatTTSText chunks.
  • 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-realtime with transport: "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:

sh
npm test

Useful Gateway log filters:

sh
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 .env files or local credential-bearing config.

License

MIT