Loading component…
Loading component…
A live voice call with an agent – both voices as audio waves with the pause between them measured, the words as they are spoken, voice-to-voice latency split up against a budget
To reuse this local React demo, copy all files from the Code tab into the same folder, then import VoiceSession from ./voice-session.
import { VoiceSession } from "@/components/ui/voice-session";
export function Call({ turns, status, levels }) {
return (
<VoiceSession
agent={{ id: "atlas", name: "Atlas" }}
subtitle="Billing support"
personName="Maya"
status={status} // "connecting" | "listening" | "thinking" | "speaking" | "ended"
turns={turns}
levels={levels} // { person: 0.4, agent: 0 } – from your audio analyser
startedAt={callStart}
onBargeIn={() => call.interrupt()}
/>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| agent | { id, name, color? } | Who is on the call – its pixel mark is drawn from the id, its voice in color (blue by default) | |
| title | string | agent.name | Heading of the card |
| subtitle | string | What the call is about, next to the heading | |
| personName | string | "You" | The person's name on their lane and in the transcript |
| personAvatar | string | The person's photo before their name – their initial in a circle without one; the agent always shows its pixel mark | |
| status | "connecting" \| "listening" \| "thinking" \| "speaking" \| "ended" | Where the call is – the badge, the mark, the lanes and the big number follow it | |
| turns | VoiceTurn[] | { id, speaker, text, spoken?, interrupted?, responseMs?, latency? } – oldest first; the last exchange is the transcript, every agent turn counts toward the P50 | |
| levels | { person?, agent? } | How loud each side is right now, 0 to 1 – sampled every 90ms into the lanes | |
| initialLevels | { person?, agent? }[] | The last seconds before the card opened, one entry per 90ms – the lanes start filled, e.g. when a call is reopened | |
| startedAt | number | Date.now() when the call started – the footer counts from here | |
| budgetMs | number | 800 | Voice to voice above this is over budget: a red badge and a red pause |
| paused | boolean | false | The lanes stand still and the call time stops |
| onPauseChange | (paused: boolean) => void | Pause / Resume | |
| onBargeIn | () => void | Barge in – take over from the agent | |
| settings | VoiceSettingsSection[] | { title?, items: { id, label, icon?, checked?, onSelect? }[] }[] – what the settings icon opens; items with checked show a check and keep the menu open | |
| showTranscript | boolean | true | The words of the turn above the lanes |
| className | string | Extra class on the card |
The card keeps its height – each transcript line keeps its newest two rows, the legend reserves its row while measuring
Below 380px the names move above their lines, the subtitle steps aside and the legend wraps
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"