Skip to content
CCinder
Using Speech

Guides

Using Speech

Practical browser speech setup, transcript handling, and unsupported-environment expectations.

Use browser speech as an input layer over the same runtime pipeline used by text commands.

Start listening

ts
6 lines
const result = await Cinder.listen({
  root: document,
  autoRun: true,
  speakFeedback: false,
});
console.log(result);

Stop listening

ts
1 line
Cinder.stopListening();

Handle transcripts and errors explicitly

ts
2 lines
Cinder.onTranscript((event) => console.log(event));
Cinder.onSpeechError((error) => console.error(error));

When to disable auto-run

Use autoRun: false when you want to:

  • inspect transcripts before execution
  • build your own voice UX layer
  • confirm transcript quality in a noisy environment

Server-side fallback for browsers with no Web Speech API

Firefox and older Safari have no native SpeechRecognition at all. Set speech.engine: "auto" and configure the same ai.endpoint/ai.apiKey already used for text tier-3 fallback, and the runtime automatically records audio and uploads it for transcription instead - no separate speech-specific config:

ts
9 lines
await Cinder.init({
  speech: { engine: 'auto', lang: 'en-US' },
  ai: {
    enabled: true,
    mode: 'hybrid',
    endpoint: 'https://your-fallback-host/v1/llm/infer',
    apiKey: '',
  },
});

This only activates when the browser itself has no native SpeechRecognition - a browser that supports Web Speech natively always uses that first. It needs a server implementing a sibling /v1/speech/transcribe route behind that same endpoint, with a transcription provider configured (OpenAI Whisper).

Not currently part of Relay

Cinder Relay does not implement speech transcription today - this path is documented for the underlying mechanism, but there is currently no publicly available server offering it.

No interim results over the server path

Unlike native SpeechRecognition, the server-side path can't stream a partial transcript while the user is still speaking - there's a transcript only once recording stops and the upload finishes. That's an honest UX difference, not a bug.

Honest expectation

Unsupported browsers without a fallback endpoint configured

With speech.engine: "browser" (or no fallback endpoint configured at all), unsupported cases fail clearly and leave text commands fully usable.

Continue reading