Cheetah Speech-to-Text
React API
API Reference for the Cheetah React SDK (npmjs).
useCheetah()
React Hook for Cheetah speech-to-text engine.
Returns
resultObject | null : Any newly-transcribed speech and a flag indicating if a transcription is complete.result.transcriptstring : A string value representing newly-transcribed speech. If none is available, an empty string is returned.result.isCompleteboolean | undefined : A flag representing whether the current result represents an endpoint (a chunk of audio after an utterance without any speech in it).isLoadedboolean : A state indicating whether the engine is initialized successfully.isListeningboolean : A state indicating whether thewebVoiceProcessoris passing audio to the engine.errorError | null : An Error object containing details about the error.init(...) => Promise<void> : A method to initializeCheetahgiven 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
accessKeystring : AccessKey obtained from Picovoice Console.modelCheetahModel : Object containing Cheetah model.optionsCheetahOptions : 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.