Rhino Speech-to-Intent
React API
API Reference for the Rhino React SDK (npmjs).
useRhino()
React Hook for Rhino
Speech-to-Intent engine.
Returns
inference
RhinoInference | null : A state containing the inference.contextInfo
string | null : Context information.isLoaded
boolean : A state indicating whether the engine is initialized successfully.isListening
boolean : A state indicating whether thewebVoiceProcessor
is passing audio to the engine and Rhino is listening for an utterance.error
Error | null : AnError
object containing details about the error.init
(...) => Promise<void> : A method to initializeRhino
given 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
accessKey
string : AccessKey obtained from Picovoice Console.context
RhinoContext : Object containing Rhino context data.model
RhinoModel : Object containing Rhino model data.options
RhinoOptions : 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.