Skip to content

Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.

4.0 KB
Raw Blame

FunASR for OpenClaw

openclaw-funasr is an experimental adapter connecting OpenClaw Talk and Voice Call to a self-hosted FunASR WebSocket server. Audio stays on infrastructure you control.

Capabilities

  • FunASR online, offline, and 2pass recognition modes
  • OpenClaw's 8 kHz G.711 mu-law input converted to 16 kHz PCM
  • Official 60 ms FunASR audio frames and the required binary WebSocket subprotocol
  • Partial and final transcripts, hotwords, inverse text normalization, and optional Bearer auth
  • Bounded audio queues and transcript retention inherited from the OpenClaw session helper

Compatibility

On 2026-10-31, openclaw/openclaw#118977 was closed without merging. This adapter still requires that experimental SDK patch; the declared >=2026.7.2 range is not a supported stock-install compatibility floor. No supported released OpenClaw version has been established by the validation below.

The build, test, installation, and configuration instructions below apply only to a development checkout containing that patch. They are not a setup recipe for an unmodified OpenClaw release.

Publishing to npm and ClawHub remains blocked pending an accepted and released upstream SDK contract. The exact compatible release and its behavior must be validated before publication; the historical local proof does not remove this requirement.

Start FunASR

Run the official FunASR WebSocket server from this repository. The server must be reachable from the OpenClaw Gateway and negotiate the binary subprotocol. See runtime/python/websocket for Docker, model, TLS, and client examples.

The default server endpoint is commonly ws://127.0.0.1:10095, but the plugin does not assume a URL. Set it explicitly in OpenClaw or through FUNASR_WS_URL.

Build and test

cd integrations/openclaw
npm ci
OPENCLAW_ROOT=/absolute/path/to/openclaw npm test
npm pack

OPENCLAW_ROOT must point to an OpenClaw checkout containing #118977. The test suite exercises the real shared WebSocket session helper, including protocol negotiation, audio conversion, 60 ms framing, finalization, reconnect handling, bounded transcript state, and package metadata.

Install the packed artifact in that experimental checkout only:

openclaw plugins install npm-pack:/absolute/path/to/openclaw-funasr-0.1.0.tgz --force
openclaw plugins inspect funasr --runtime --json

Configure OpenClaw

FunASR provider options live under Voice Call's generic streaming provider map. The same provider map is currently used by Talk transcription sessions.

{
  plugins: {
    entries: {
      "voice-call": {
        config: {
          streaming: {
            enabled: true,
            provider: "funasr",
            providers: {
              funasr: {
                baseUrl: "ws://127.0.0.1:10095",
                mode: "2pass",
                hotwords: "OpenClaw,FunASR",
                useItn: true
              }
            }
          }
        }
      }
    }
  }
}

Options:

Option Default Description
baseUrl FUNASR_WS_URL http, https, ws, or wss endpoint
apiKey FUNASR_API_KEY Optional Bearer token for a reverse proxy
mode 2pass online, offline, or 2pass
hotwords empty FunASR hotword string
useItn true Enable inverse text normalization

Embedded credentials in baseUrl are rejected. Use apiKey or FUNASR_API_KEY instead.

Verified behavior

The following is historical local protocol proof with the required SDK patch, not validation of a released OpenClaw installation.

The end-to-end proof used the official FunASR server, a public 5.55 second 16 kHz sample converted to the same 8 kHz mu-law frames emitted by OpenClaw, and the plugin's production adapter. It streamed 278 audio frames, produced seven partial transcripts, returned the exact final transcript, and completed without client errors.

License

MIT