Valora
API ReferenceLocal APIs

useVAD

React hook — real-time mic voice-activity detection (Silero).

Auto-generated from JSDoc in packages/react/src/local/useVAD.ts. Do not edit — run npm run docs:api.

useVAD

function
function useVAD(opts: UseVADOptions): UseVAD

UseVAD

interface
interface UseVAD

status: VADStatus

error?: Error

start: () => Promise<void>

Request mic permission, load the model, begin listening.

stop: () => void

Stop listening (keeps the loaded model for a fast restart).

UseVADOptions

interface
interface UseVADOptions

onSpeechEnd?: (audio: Float32Array) => void

Called with the 16 kHz Float32 audio of each completed speech segment.

onSpeechStart?: () => void

baseAssetPath?: string

Override the CDN paths for the model + onnx wasm if self-hosting.

onnxWASMBasePath?: string

VADStatus

type alias
type VADStatus = idle | loading | listening | speaking | error

On this page

Valora is local-first

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

Star on GitHub