Picovoice Wordmark
Start Building
Introduction
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryPicovoice picoLLMGPTQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-TextWhisper Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustWeb
SummaryPicovoice Cheetah
FAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryAmazon PollyAzure TTSElevenLabsOpenAI TTSPicovoice Orca
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice KoalaMozilla RNNoise
Introduction
AndroidCiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidCNode.jsPythoniOSWeb
SummaryPicovoice EaglepyannoteSpeechBrainWeSpeaker
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice FalconAmazon TranscribeAzure Speech-to-TextGoogle Speech-to-Textpyannote
Introduction
AndroidArduinoCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSMicrocontrollerNode.jsPythonRaspberry PiReactReact NativeRustSafariUnityWebWindows
AndroidC.NETFlutteriOSJavaMicrocontrollerNode.jsPythonReactReact NativeRustUnityWeb
SummaryPorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustSafariUnityWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustUnityWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiRustWebWindows
AndroidC.NETiOSNode.jsPythonRustWeb
SummaryPicovoice CobraWebRTC VAD
FAQ
Introduction
AndroidC.NETFlutteriOSNode.jsPythonReact NativeRustUnityWeb
AndroidC.NETFlutteriOSNode.jsPythonReact NativeRustUnityWeb
Introduction
C.NETNode.jsPython
C.NETNode.jsPython
FAQGlossary

Rhino Speech-to-Intent
Web API

API Reference for the Rhino Web SDK (npmjs).


Rhino

class Rhino {}

Class for the Rhino Speech-to-Intent engine.


Rhino.create()

static async function create(
accessKey: string,
context: RhinoContext,
inferenceCallback: InferenceCallback,
model: RhinoModel,
options: RhinoOptions = {}
): Promise<Rhino> {

Creates an instance of the Rhino Speech-to-Intent engine. The model size is large, hence it will try to use the existing one if it exists, otherwise saves the model in storage.

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console.
  • context RhinoContext : Object containing Rhino context data.
  • inferenceCallback InferenceCallback : User-defined callback invoked upon processing a frame of audio.
  • model RhinoModel : Object containing Rhino model data.
  • options RhinoOptions : Optional configuration arguments.

Returns

  • Rhino : An instance of the Rhino engine.

Rhino.process()

async function process(pcm: Int16Array): Promise<void>

Processes a frame of audio. The required sample rate can be retrieved from .sampleRate and the length of frame (number of audio samples per frame) can be retrieved from .frameLength. The audio must be single-channel and 16-bit linearly-encoded. Detected inferences are returned via the inferenceCallback callback.

Parameters

  • pcm Int16Array : A frame of audio.

Rhino.reset()

async function reset(): Promise<void>

Resets the internal Rhino state.


Rhino.release()

async function release(): Promise<void>

Releases resources acquired by the Rhino Web SDK.


Rhino.contextInfo

get contextInfo(): number

Stores the source of the Rhino context in YAML format. Shows the list of intents, which expressions map to those intents, as well as slots and their possible values.


Rhino.frameLength

get framelength(): number

Number of audio samples per frame.


Rhino.sampleRate

get sampleRate(): number

Audio sample rate accepted by Rhino.


Rhino.version

get version(): string

Rhino version string.


RhinoWorker

class RhinoWorker {}

Class for creating instances of the RhinoWorker.


RhinoWorker.create()

static async function create(
accessKey: string,
context: RhinoContext,
inferenceCallback: InferenceCallback,
model: RhinoModel,
options: RhinoOptions = {}
): Promise<RhinoWorker> {

Creates a worker instance of the RhinoWorker using a base64'd string of the model file. The model size is large, hence it will try to use the existing one if it exists, otherwise saves the model in storage.

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console.
  • context RhinoContext : Object containing Rhino context data.
  • inferenceCallback InferenceCallback : User-defined callback invoked upon processing a frame of audio.
  • model RhinoModel : Object containing Rhino model data.
  • options RhinoOptions : Optional configuration arguments.

Returns

  • RhinoWorker : An instance of RhinoWorker.

RhinoWorker.process()

function process(pcm: Int16Array): void

Processes a frame of audio. The required sample rate can be retrieved from .sampleRate and the length of frame (number of audio samples per frame) can be retrieved from .frameLength. The audio must be single-channel and 16-bit linearly-encoded. Detected inferences are returned via the inferenceCallback callback.

Parameters

  • pcm Int16Array : A frame of audio.

RhinoWorker.reset()

async function reset(): Promise<void>

Resets the internal Rhino state.


RhinoWorker.release()

function release(): Promise<void>

Releases resources acquired by the Rhino Web SDK.


RhinoWorker.terminate()

function release(): Promise<void>

Terminates the active worker. Stops all requests being handled by worker.


RhinoWorker.contextInfo

get contextInfo(): number

Stores the source of the Rhino context in YAML format. Shows the list of intents, which expressions map to those intents, as well as slots and their possible values.


RhinoWorker.frameLength

get framelength(): number

Number of audio samples per frame.


RhinoWorker.sampleRate

get sampleRate(): number

Audio sample rate accepted by Rhino.


RhinoWorker.version

get version(): string

Rhino version string.


InferenceCallback

type InferenceCallback = (inference: RhinoInference) => void;

Type defining the interface for the user-defined inferenceCallback used to receive inference results from the Rhino engine.

Parameters

  • inference RhinoInference : Inference data.

RhinoInference

type RhinoInference = {
isFinalized: boolean
isUnderstood?: boolean
intent?: string
slots?: Record<string, string>
}

Type containing inference result data returned from the Rhino engine.

Parameters

  • isFinalized boolean : When true, Rhino has concluded the inference.
  • isUnderstood boolean : If isFinalized, indicates if the intent was understood based on the context.
  • intent string : If isUnderstood, the name of the intent that was inferred.
  • slots Record<string, string> : If isUnderstood, a map of the slot keys and values that were inferred.

RhinoContext

type PvModel = {
base64?: string;
publicPath?: string;
customWritePath?: string;
forceWrite?: boolean;
version?: number;
};
type RhinoContext = PvModel & {
sensitivity?: number;
};

Type representing a context created using the Picovoice Console. One of base64 or publicPath must be specified.

Parameters

  • base64 string : Optional. Base64 representation of a trained Rhino context (.rhn file).
  • publicPath string : Optional. The Rhino context (.rhn file) path relative to the public directory.
  • customWritePath string : Optional. Custom path to save the model in storage.
  • forceWrite boolean : Optional. A flag that indicates whether to overwrite the context in storage even if it exists.
  • version number : Optional. Version of file in storage. Set to a higher number to update the model file.
  • sensitivity number : Optional. Inference sensitivity. It should be a number within [0, 1]. A higher sensitivity value results in fewer misses at the cost of (potentially) increasing the erroneous inference rate.

RhinoModel

type PvModel = {
base64?: string;
publicPath?: string;
customWritePath?: string;
forceWrite?: boolean;
version?: number;
};
type RhinoModel = PvModel;

Type representing a context created using the Picovoice Console. One of base64 or publicPath must be specified.

Parameters

  • base64 string : Optional. Base64 representation of a Rhino parameter model (.pv file).
  • publicPath string : Optional. The Rhino parameter model (.pv file) path relative to the public directory.
  • customWritePath string : Optional. Custom path to save the model in storage.
  • forceWrite boolean : Optional. A flag that indicates whether to overwrite the context in storage even if it exists.
  • version number : Optional. Version of file in storage. Set to a higher number to update the model file.

RhinoOptions

type RhinoOptions = {
endpointDurationSec?: number;
requireEndpoint?: boolean;
processErrorCallback?: (error: string) => void;
};

Type containing optional arguments used then creating an instance of Rhino.

Parameters

  • endpointDurationSec number : Optional. Endpoint duration in seconds. An endpoint is a chunk of silence at the end of an utterance that marks the end of spoken command. It should be a positive number within [0.5, 5]. A lower endpoint duration reduces delay and improves responsiveness. A higher endpoint duration assures Rhino doesn't return inference preemptively in case the user pauses before finishing the request.
  • requireEndpoint boolean : Optional. If set to true, Rhino requires an endpoint (a chunk of silence) after the spoken command. If set to false, Rhino tries to detect silence, but if it cannot, it still will provide inference regardless. Set to false only if operating in an environment with overlapping speech (e.g. people talking in the background).
  • processErrorCallback (error: string) => void : Optional. Callback invoked if an error is encountered when calling .process().

RhinoError

class RhinoError extends Error { }

Error thrown if an error occurs within Rhino Speech-to-Intent engine.

Errors:

class RhinoActivationError extends RhinoError { }
class RhinoActivationLimitError extends RhinoError { }
class RhinoActivationRefusedError extends RhinoError { }
class RhinoActivationThrottledError extends RhinoError { }
class RhinoIOError extends RhinoError { }
class RhinoInvalidArgumentError extends RhinoError { }
class RhinoInvalidStateError extends RhinoError { }
class RhinoKeyError extends RhinoError { }
class RhinoMemoryError extends RhinoError { }
class RhinoRuntimeError extends RhinoError { }
class RhinoStopIterationError extends RhinoError { }

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Rhino Speech-to-Intent Web API
  • Rhino
  • create()
  • process()
  • reset()
  • release()
  • contextInfo
  • frameLength
  • sampleRate
  • version
  • RhinoWorker
  • create()
  • process()
  • reset()
  • release()
  • terminate()
  • contextInfo
  • frameLength
  • sampleRate
  • version
  • InferenceCallback
  • RhinoInference
  • RhinoContext
  • RhinoModel
  • RhinoOptions
  • RhinoError
Voice AI
  • Leopard Speech-to-Text
  • Cheetah Streaming Speech-to-Text
  • Orca Text-to-Speech
  • Koala Noise Suppression
  • Eagle Speaker Recognition
  • Falcon Speaker Diarization
  • Porcupine Wake Word
  • Rhino Speech-to-Intent
  • Cobra Voice Activity Detection
Local LLM
  • picoLLM Inference
  • picoLLM Compression
  • picoLLM GYM
Resources
  • Docs
  • Console
  • Blog
  • Use Cases
  • Playground
Sales & Services
  • Consulting
  • Foundation Plan
  • Enterprise Plan
  • Enterprise Support
Company
  • About us
  • Careers
Follow Picovoice
  • LinkedIn
  • GitHub
  • X
  • YouTube
  • AngelList
Subscribe to our newsletter
Terms of Use
Privacy Policy
© 2019-2025 Picovoice Inc.