UseVoiceResult
Defined in: src/react/useVoice.ts:85
Result returned by the useVoice hook.
Properties
abortNativeTranscription()
abortNativeTranscription: () =>
void
Defined in: src/react/useVoice.ts:117
Abort on-device speech recognition without returning a result.
Returns
void
disposeModel()
disposeModel: () =>
Promise<void>
Defined in: src/react/useVoice.ts:99
Dispose the loaded model to free WASM memory. Useful on memory-constrained devices (mobile).
Returns
Promise<void>
error
error:
Error|null
Defined in: src/react/useVoice.ts:109
Error from the last operation
isLoadingModel
isLoadingModel:
boolean
Defined in: src/react/useVoice.ts:103
Whether the Whisper model is currently loading/downloading
isModelLoaded
isModelLoaded:
boolean
Defined in: src/react/useVoice.ts:101
Whether the Whisper model has been loaded
isNativeListening
isNativeListening:
boolean
Defined in: src/react/useVoice.ts:119
Whether on-device speech recognition is currently listening.
isRecording
isRecording:
boolean
Defined in: src/react/useVoice.ts:87
Whether the microphone is currently recording
isTranscribing
isTranscribing:
boolean
Defined in: src/react/useVoice.ts:93
Whether transcription is in progress
nativeSpeechAvailable
nativeSpeechAvailable:
boolean
Defined in: src/react/useVoice.ts:111
Whether on-device speech recognition is available (iOS Safari). No audio leaves the device.
preloadModel()
preloadModel: () =>
Promise<void>
Defined in: src/react/useVoice.ts:97
Preload the Whisper model so transcription starts instantly later
Returns
Promise<void>
recording
recording:
VoiceRecording|null
Defined in: src/react/useVoice.ts:105
The last recording
startNativeTranscription()
startNativeTranscription: () =>
void
Defined in: src/react/useVoice.ts:113
Start on-device speech recognition. Call stopNativeTranscription() to get the result.
Returns
void
startRecording()
startRecording: () =>
Promise<void>
Defined in: src/react/useVoice.ts:89
Start recording from the microphone
Returns
Promise<void>
stopNativeTranscription()
stopNativeTranscription: () =>
Promise<TranscriptionResult>
Defined in: src/react/useVoice.ts:115
Stop on-device speech recognition and return the accumulated text.
Returns
Promise<TranscriptionResult>
stopRecording()
stopRecording: () =>
Promise<VoiceRecording>
Defined in: src/react/useVoice.ts:91
Stop recording and return the audio
Returns
Promise<VoiceRecording>
transcribe()
transcribe: (
recording?:VoiceRecording) =>Promise<TranscriptionResult>
Defined in: src/react/useVoice.ts:95
Transcribe a recording. Uses the last recording if none provided.
Parameters
| Parameter | Type |
|---|---|
|
|
Returns
Promise<TranscriptionResult>
transcription
transcription:
TranscriptionResult|null
Defined in: src/react/useVoice.ts:107
The last transcription result