Skip to content
English
Voice mode comes with Pro. Its preview shows once you unlock it.

Usage

import { ChatVoice } from './ChatVoice.jsx'

// Without status the block plays its sample conversation. Drive it from your speech pipeline:
<ChatVoice
  locale="en"
  status={call.status}          // 'idle' | 'listening' | 'thinking' | 'speaking' | 'ended'
  transcript={call.lines}       // [{ id, role: 'user' | 'assistant', text, shown? }]; shown = characters said so far
  level={call.micLevel}         // 0..1, how loud the current voice is
  onStart={() => call.start()}
  onMute={(muted) => call.mute(muted)}
  onEnd={() => call.hangUp()}
  onSend={(text) => call.say(text)}
  error={call.micBlocked}
  onRetry={() => call.askForMicrophone()}
/>

Props

PropTypeDefaultWhat it does
locale'en' | 'zh-CN' | 'es' | 'ja''en'Language of the built-in text and the sample conversation.
status / transcript / levelstring / Array<{ id, role, text, shown? }> / number—Drive the block from your own speech: the turn the orb shows, the captions (shown is how many characters are said so far, with a caret) and the voice’s loudness from 0 to 1. Without status the sample plays.
scriptArray<{ role: 'user' | 'assistant', text }>sample tripThe conversation the block plays by itself when it is not driven.
autoStartbooleantrueStarts listening at once; false waits for a tap on the orb.
onStart / onMute / onEnd() => void / (muted) => void / ({ seconds }) => void—The orb was tapped to start, the microphone was muted or unmuted, the conversation was ended.
onSend(text) => Promise<string> | void—A message was typed instead of said. Resolve with the reply and the sample speaks it.
error / onRetryboolean / () => Promise | voidfalseThe microphone is blocked: shows how to allow it, Try again (onRetry) and Type instead.
labelsobject—Replaces any built-in text (keys as in copy.js).
classNamestring—Extra class on the root element.

Add it to your project

Pro includes the full source of this block. Copy its prompt to install it with your coding agent.

ChatVoice.jsxchat-voice.csscopy.jskit.jsxkit.cssui/base-button/tokens.cssREADME.md

The block, its stylesheet and text, the shared kit, the components it uses and tokens.css install together into one folder.