Cheetah Speech-to-Text
React API
API Reference for the Cheetah React SDK (npmjs).
useCheetah()
React Hook for Cheetah
speech-to-text engine.
Returns
result
Object | null : Any newly-transcribed speech and a flag indicating if a transcription is complete.result.transcript
string : A string value representing newly-transcribed speech. If none is available, an empty string is returned.result.isComplete
boolean | undefined : A flag representing whether the current result represents an endpoint (a chunk of audio after an utterance without any speech in it).isLoaded
boolean : A state indicating whether the engine is initialized successfully.isListening
boolean : A state indicating whether thewebVoiceProcessor
is passing audio to the engine.error
Error | null : An Error object containing details about the error.init
(...) => Promise<void> : A method to initializeCheetah
given the arguments. Seeinit
.start
(...) => Promise<void> : A method to start recording and processing audio. Seestart
.stop
() => Promise<void> : A method to stop recording and processing audio. Seestop
.release
() => Promise<void> : Releases resources acquired byuseCheetah
. Seerelease
.
init()
Initializes useCheetah
hook. Sets isLoaded
to true
.
Parameters
accessKey
string : AccessKey obtained from Picovoice Console.model
CheetahModel : Object containing Cheetah model.options
CheetahOptions : Optional configuration arguments.
start()
Start recording and processing audio. If started, isListening
is set to true
.
stop()
Stop recording and processing audio. Sets isListening
to false
.
release()
Releases resources acquired by the useCheetah
.