Valora
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 — run npm run docs:api.

useLocalTTS

function
function useLocalTTS(opts: UseLocalTTSOptions): UseLocalTTS

UseLocalTTS

interface
interface UseLocalTTS

status: 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

interface
interface UseLocalTTSOptions

device?: unknown

Default "webgpu". Falls back to "wasm" if you prefer CPU.

dtype?: unknown

autoLoad?: boolean

TTSStatus

type alias
type TTSStatus = idle | loading | ready | speaking | error

On this page

Valora is local-first

No API key, no server — everything in this doc runs on-device.

Star on GitHub