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
Python API

API Reference for the Python Rhino SDK (PyPI).


pvrhino.create()

def create(
access_key: str,
context_path: str,
library_path: Optional[str] = None,
model_path: Optional[str] = None,
sensitivity: Optional[float] = 0.5,
endpoint_duration_sec: Optional[float] = 1.,
require_endpoint: Optional[bool] = True) -> Rhino

Factory method for Rhino Speech-to-Intent engine.

Parameters

  • access_key str : AccessKey obtained from Picovoice Console.
  • context_path str : Absolute path to file containing context model(file with .rhn extension). A context represents the set of expressions (spoken commands), intents, and intent arguments (slots) within a domain of interest.
  • library_path Optional[str] : Absolute path to Rhino's dynamic library. If not set it will be set to the default location.
  • model_path Optional[str] : Absolute path to the file containing model parameters. If not set it will be set to the default location.
  • sensitivity Optional[float] : 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.
  • endpoint_duration_sec Optional[float] : 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 pre-emptively in case the user pauses before finishing the request.
  • requireEndpoint Optional[bool] : 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.

Returns

  • Rhino: An instance of Rhino Speech-to-Intent engine.

Throws

  • RhinoError

pvrhino.Rhino

class Rhino(object)

Class for the Rhino Speech-to-Intent engine. Rhino can be initialized either using the module level create() function or directly using the class __init__() method. Resources should be cleaned when you are done using the delete() method.


pvrhino.Rhino.context_info

self.context_info: str

The context information of the Rhino instance.


pvrhino.Rhino.version

self.version: str

The version string of the Rhino library.


pvrhino.Rhino.frame_length

self.frame_length: int

The number of audio samples per frame that Rhino accepts.


pvrhino.Rhino.sample_rate

self.sample_rate: int

The audio sample rate the Rhino accepts.


pvrhino.Rhino.__init__()

def __init__(
self,
access_key: str,
library_path: str,
model_path: str,
context_path: str,
sensitivity: Optional[float] = 0.5,
require_endpoint: Optional[bool] = True) -> Rhino

__init__ method for Rhino Speech-to-Intent engine.

Parameters

  • access_key str : AccessKey obtained from Picovoice Console.
  • library_path str : Absolute path to Rhino's dynamic library.
  • model_path str : Absolute path to the file containing model parameters.
  • context_path str : Absolute path to the file containing model parameters.
  • sensitivity Optional[float] : 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.
  • requireEndpoint Optional[bool] : If set to False, Rhino does not require an endpoint (chunk of silence) before finishing inference.

Returns

  • Rhino: An instance of Rhino Speech-to-Intent engine.

Throws

  • RhinoError

pvrhino.Rhino.delete()

def delete(self)

Releases resources acquired by Rhino.


pvrhino.Rhino.get_inference()

def get_inference(self)

Gets inference results from Rhino. If the spoken command was understood, it includes the specific intent name that was inferred, and (if applicable) slot keys and specific slot values. Should only be called after the process function returns true, otherwise Rhino has not yet reached an inference conclusion.

Returns

  • Inference: An immutable object with .is_understood, .intent , and .slots getters.

Throws

  • RhinoError

pvrhino.Rhino.process()

def process(self, pcm: List[int]) -> bool

Processes a frame of audio and emits a flag indicating if the inference is finalized. When finalized, .get_inference() should be called to retrieve the intent and slots, if the spoken command is considered valid. The number of samples per frame can be attained by calling .frame_length. The incoming audio needs to have a sample rate equal to .sample_rate and be 16-bit linearly-encoded. Rhino operates on single-channel audio.

Parameters

  • pcm List[int] : A frame of audio samples.

Returns

  • bool : Flag indicating if the inference is finalized.

Throws

  • RhinoError

pvrhino.Rhino.reset()

def reset(self)

Resets the internal state of Rhino. It should be called before the engine can be used to infer intent from a new stream of audio.

Throws

  • RhinoError

pvrhino.Rhino.Inference

Inference = namedtuple('Inference', ['is_understood', 'intent', 'slots'])

Immutable object containing Rhino inference information.

Getters

  • is_understood bool : whether Rhino understood what it heard based on the context
  • intent str : name of intent that was inferred
  • slots dict : dictionary of slot keys and values that were inferred

pvrhino.RhinoError

class RhinoError(Exception)

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

Exceptions

class RhinoActivationError(RhinoError)
class RhinoActivationLimitError(RhinoError)
class RhinoActivationRefusedError(RhinoError)
class RhinoActivationThrottledError(RhinoError)
class RhinoIOError(RhinoError)
class RhinoInvalidArgumentError(RhinoError)
class RhinoInvalidStateError(RhinoError)
class RhinoKeyError(RhinoError)
class RhinoMemoryError(RhinoError)
class RhinoRuntimeError(RhinoError)
class RhinoStopIterationError(RhinoError)

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Rhino Speech-to-Intent Python API
  • pvrhino.create()
  • pvrhino.Rhino
  • context_info
  • version
  • frame_length
  • sample_rate
  • __init__()
  • delete()
  • get_inference()
  • process()
  • reset()
  • Inference
  • pvrhino.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.