Rhino Speech-to-Intent
React API
API Reference for the Rhino React SDK (npmjs).
useRhino()
React Hook for Rhino Speech-to-Intent engine.
Returns
inferenceRhinoInference | null : A state containing the inference.contextInfostring | null : Context information.isLoadedboolean : A state indicating whether the engine is initialized successfully.isListeningboolean : A state indicating whether thewebVoiceProcessoris passing audio to the engine and Rhino is listening for an utterance.errorError | null : AnErrorobject containing details about the error.init(...) => Promise<void> : A method to initializeRhinogiven the arguments. Seeinit.process() => Promise<void> : A method to start processing audio. Seeprocess.release() => Promise<void> : Releases resources acquired byuseRhino. Seerelease.
init()
Initializes the Rhino Speech-to-Intent engine. Sets isLoaded to true on success.
Parameters
accessKeystring : AccessKey obtained from Picovoice Console.contextRhinoContext : Object containing Rhino context data.modelRhinoModel : Object containing Rhino model data.optionsRhinoOptions : Optional configuration arguments.
process()
Puts the RhinoService in an active isListening state. The process function initializes WebVoiceProcessor. Rhino will then listen and process frames of microphone audio until it reaches a conclusion, then return the result via the inference state. Once a conclusion is reached Rhino will enter a paused state. From the paused state call process again to detect another inference.
release()
Releases resources acquired by the Rhino React SDK.