Web browser
Example: examples/web
cd examples/webbun run start # http://localhost:5173The live demo is this example bundled for production: ottervoice.vercel.app
Minimal wiring
Section titled “Minimal wiring”import { createVoiceSession } from '@ottervoice/core';import { createWebRuntime } from '@ottervoice/runtime-web';
const runtime = createWebRuntime({ mimeType: 'audio/webm;codecs=opus', timesliceMs: 100, volumePollMs: 50, bargeInPreRollMs: 500,});
const session = createVoiceSession({ mode: 'full_duplex', pipeline: 'asr_llm_tts', // or 'audio_llm' runtime, language: 'en', providers: { asr, llm, tts }, turnDetection: { strategy: 'volume', minSpeechMs: 180, silenceTimeoutMs: 450, volumeThreshold: 0.025, }, policy: { autoStartListening: true, allowInterruption: true, },});
await session.start();Browser checklist
Section titled “Browser checklist”- Serve over HTTPS or
localhost - Request the mic (and prefer
audioOutput.unlock?.()) from a user gesture - Autoplay unlock failure must not block ASR
- Call
await session.dispose()when leaving the page
See @ottervoice/runtime-web for options.