Live voice
A live session lets an authorized application exchange microphone audio, transcripts, answer text and spoken output with an incdai deployment.
Public behavior
- English and Swahili conversation.
- Streaming transcripts and answer text.
- Server speech when the node declares it, with device speech as a fallback.
- Interruption and explicit end-turn controls.
- Optional wake-word behavior.
JavaScript
import { Incdai } from "https://api.incdai.incpritech.com/sdk.js";
const client = new Incdai({ api: "https://api.incdai.incpritech.com", site: "your-site" });
const live = client.live();
live.on("state", (event) => showState(event.state));
live.on("transcript", (event) => showMessage("you", event.text));
live.on("token", (event) => appendAnswer(event.text));
button.onclick = () => live.start();
Protocol boundary
The live endpoint uses a WebSocket. JSON events describe session state, transcripts, answer text, speech and completion; binary frames carry negotiated audio. The SDK handles microphone capture, playback and interruption for browser applications.
| Direction | Public messages |
|---|---|
| Application to node | hello, audio, text, end_turn, interrupt, bye |
| Node to application | ready, speech state, transcript, token, speak, audio, done, error, bye |
A speak event may include pronunciation-safe speech. Display text; use speech only for device text-to-speech.
Turn detection, speech services, buffering, fallback selection, latency controls and production limits are private implementation details.