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
| Prop | Type | Default | What it does |
|---|---|---|---|
locale | 'en' | 'zh-CN' | 'es' | 'ja' | 'en' | Language of the built-in text and the sample conversation. |
status / transcript / level | string / 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. |
script | Array<{ role: 'user' | 'assistant', text }> | sample trip | The conversation the block plays by itself when it is not driven. |
autoStart | boolean | true | Starts 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 / onRetry | boolean / () => Promise | void | false | The microphone is blocked: shows how to allow it, Try again (onRetry) and Type instead. |
labels | object | — | Replaces any built-in text (keys as in copy.js). |
className | string | — | 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.
