API ReferenceLocal APIs
useLocalTTS
React hook — on-device text-to-speech (Kokoro) over WebGPU.
Auto-generated from JSDoc in
packages/react/src/local/useLocalTTS.ts. Do not edit — runnpm run docs:api.
useLocalTTS
functionfunction useLocalTTS(opts: UseLocalTTSOptions): UseLocalTTSUseLocalTTS
interfaceinterface UseLocalTTSstatus: TTSStatus
progress: number
voices: string[]
error?: Error
audioUrl?: string
Object URL of the most recent synthesized clip (revoked + replaced on each speak).
load: () => Promise<SpeechModel>
speak: (text: string, voice?: string) => Promise<void>
UseLocalTTSOptions
interfaceinterface UseLocalTTSOptionsdevice?: unknown
Default "webgpu". Falls back to "wasm" if you prefer CPU.
dtype?: unknown
autoLoad?: boolean
TTSStatus
type aliastype TTSStatus = idle | loading | ready | speaking | error