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

API Reference for the Android Rhino SDK (rhino-android)

package: ai.picovoice.rhino


Rhino

public class Rhino { }

Class for the Rhino Speech-to-Intent engine.

Rhino can be initialized using the Rhino.Builder Class. Resources should be cleaned when you are done using the delete() function.

Use this class when using a custom audio processing pipeline. Otherwise it is recommended to use the RhinoManager High-Level API, which contains integrated audio recording.

Rhino.delete()

public void delete()

Releases resources acquired by Rhino.


Rhino.getFrameLength()

public int getFrameLength()

Getter for number of audio samples per frame.

Returns

  • int: Number of audio samples per frame.

Rhino.getSampleRate()

public int getSampleRate()

Getter for audio sample rate accepted by Picovoice.

Returns

  • int: Audio sample rate accepted by Picovoice.

Rhino.getVersion()

public String getVersion()

Getter for version.

Returns

  • String: Current Rhino version.

Rhino.getContextInformation()

public String getContextInformation()

Getter for context information.

Returns

  • String: Returns the context information.

Rhino.process()

public boolean process(short[] pcm) throws RhinoException

Processes a frame of the incoming audio stream and emits a flag indicating if the inference is finalized. The number of samples per frame can be attained by calling getFrameLength(). The incoming audio needs to have a sample rate equal to getSampleRate() and be 16-bit linearly-encoded. Rhino operates on single-channel audio.

Parameters

  • pcm short[] : A frame of audio samples.

Returns

  • boolean: Flag indicating whether the engine has finalized intent inference.

Throws

  • RhinoException: If there is an error while processing the audio frame.

Rhino.reset()

public void reset() throws RhinoException

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

  • RhinoException: If reset fails.

Rhino.getInference()

public RhinoInference getInference() throws RhinoException

Gets inference result. 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

  • RhinoInference: The result of inference.

Throws

  • RhinoException: If inference retrieval fails.

Rhino.Builder

public static class Builder { }

Builder for creating an instance of Rhino with a mixture of default arguments.


Rhino.Builder.build()

public Rhino build() throws RhinoException

Creates an instance of Rhino Speech-to-Intent engine.

Returns

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

Throws

  • RhinoException: If an error occurs while creating an instance of Rhino Speech-to-Intent engine.

Rhino.Builder.setAccessKey()

public Rhino.Builder setAccessKey(String accessKey)

Sets the AccessKey of the builder.

Parameters

  • accessKey String : AccessKey obtained from Picovoice Console.

Returns

  • Rhino.Builder: Modified Rhino.Builder object.

Rhino.Builder.setContextPath()

public Rhino.Builder setContextPath(String contextPath)

Sets the context path of the builder.

Parameters

  • contextPath String : Path to the context file (.rhn). Can be either a path that is relative to the project's assets folder or an absolute path to the file on device.

Returns

  • Rhino.Builder: Modified Rhino.Builder object.

Rhino.Builder.setModelPath()

public Rhino.Builder setModelPath(String modelPath)

Sets the model path of the builder. If not set it will be set to the default location.

Parameters

  • modelPath String : Path to the file containing model parameters (.pv). Can be either a path that is relative to the project's assets folder or an absolute path to the file on device.

Returns

  • Rhino.Builder: Modified Rhino.Builder object.

Rhino.Builder.setSensitivity()

public Rhino.Builder setSensitivity(float sensitivity)

Sets sensitivity of the builder. Value should be a number within [0, 1]. A higher sensitivity results in fewer misses at the cost of increasing the false alarm rate.

Parameters

  • sensitivity float: Sensitivity for inference.

Returns

  • Rhino.Builder: Modified Rhino.Builder object.

Rhino.Builder.setEndpointDurationSec()

public Rhino.Builder setEndpointDurationSec(float endpointDurationSec)

Sets the 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 ensures Rhino doesn't return inference pre-emptively in case the user pauses before finishing the request.

Parameters

  • endpointDurationSec float: Endpoint duration in seconds.

Returns

  • Rhino.Builder: Modified Rhino.Builder object.

Rhino.Builder.setRequireEndpoint()

public Rhino.Builder setRequireEndpoint(boolean requireEndpoint)

Sets requireEndpoint of the Builder. 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).

Parameters

  • requireEndpoint boolean: Indicates whether an endpoint is required for Rhino to finish inference.

Returns

  • Rhino.Builder: Modified Rhino.Builder object.

RhinoInference

public class RhinoInference { }

Class that contains Rhino inference data.


RhinoInference.getIsUnderstood()

public boolean getIsUnderstood()

Getter for the isUnderstood flag.

Returns

  • boolean: If true, Rhino understood the inference.

RhinoInference.getIntent()

public String getIntent()

Getter for the inference intent name.

Returns

  • String: Inference intent name.

RhinoInference.getSlots()

public Map<String, String> getSlots()

Getter for the inference slots and values.

Returns

  • Map<String, String>: Map for inference slots and values.

RhinoException

public class RhinoException extends Exception { }

Exception thrown if an error occurs within the Rhino engine.

Exceptions:

public class RhinoActivationException extends RhinoException { }
public class RhinoActivationLimitException extends RhinoException { }
public class RhinoActivationRefusedException extends RhinoException { }
public class RhinoActivationThrottledException extends RhinoException { }
public class RhinoIOException extends RhinoException { }
public class RhinoInvalidArgumentException extends RhinoException { }
public class RhinoInvalidStateException extends RhinoException { }
public class RhinoKeyException extends RhinoException { }
public class RhinoMemoryException extends RhinoException { }
public class RhinoRuntimeException extends RhinoException { }
public class RhinoStopIterationException extends RhinoException { }

RhinoManager

public class RhinoManager { }

High-level Android binding for Rhino Speech-to-Intent engine. It handles recording audio from microphone, processes it in real-time using Rhino, and notifies the client when an intent is inferred from the spoken command.

This class offers integrated audio capture. For use-cases where there is already an audio-processing pipeline in place, use the Rhino Low-Level API.

RhinoManager.delete()

public void delete()

Releases resources acquired by RhinoManager.


RhinoManager.getVersion()

public String getVersion()

Getter for version.

Returns

  • String: Current Rhino version.

RhinoManager.process()

public void process() throws RhinoException

Start recording audio from the microphone and infers the user's intent from the spoken command. Once the inference is finalized it will invoke the user provided callback and terminate recording.

Throws

  • RhinoException: If an error occurs while starting RhinoManager.

RhinoManager.getContextInformation()

public String getContextInformation()

Getter for context information.

Returns

  • String: Returns the context information.

RhinoManager.Builder

public static class Builder { }

Builder for creating an instance of RhinoManager with a mixture of default arguments.


RhinoManager.Builder.build()

public RhinoManager build(Context context, RhinoManagerCallback callback) throws RhinoException

Creates an instance of RhinoManager.

Parameters

  • context Context : The Android app context.
  • callback RhinoManagerCallback : A callback function that is invoked when intent has been inferred. The callback must be an instance of RhinoManagerCallback.

Returns

  • RhinoManager: An instance of RhinoManager.

Throws

  • RhinoException: If an error occurs while creating an instance of RhinoManager.

RhinoManager.Builder.setAccessKey()

public RhinoManager.Builder setAccessKey(String accessKey)

Sets the AccessKey of the builder.

Parameters

  • accessKey String : AccessKey obtained from Picovoice Console.

Returns

  • RhinoManager.Builder: The instance of RhinoManager.Builder object.

RhinoManager.Builder.setContextPath()

public RhinoManager.Builder setContextPath(String contextPath)

Sets the context path of the builder.

Parameters

  • contextPath String : Path to the context file (.rhn). Can be either a path that is relative to the project's assets folder or an absolute path to the file on device.

Returns

  • RhinoManager.Builder: Modified RhinoManager.Builder object.

RhinoManager.Builder.setModelPath()

public RhinoManager.Builder setModelPath(String modelPath)

Sets the model path of the builder. If not set it will be set to the default location.

Parameters

  • modelPath String : Path to the file containing model parameters (.pv). Can be either a path that is relative to the project's assets folder or an absolute path to the file on device.

Returns

  • RhinoManager.Builder: Modified RhinoManager.Builder object.

RhinoManager.Builder.setSensitivity()

public RhinoManager.Builder setSensitivity(float sensitivity)

Sets sensitivity of the builder. Value should be a number within [0, 1]. A higher sensitivity results in fewer misses at the cost of increasing the false alarm rate.

Parameters

  • sensitivity float: Sensitivity for inference.

Returns

  • RhinoManager.Builder: Modified RhinoManager.Builder object.

RhinoManager.Builder.setEndpointDurationSec()

public RhinoManager.Builder setEndpointDurationSec(float endpointDurationSec)

Sets the 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 ensures Rhino doesn't return inference pre-emptively in case the user pauses before finishing the request.

Parameters

  • endpointDurationSec float: Endpoint duration in seconds.

Returns

  • RhinoManager.Builder: Modified RhinoManager.Builder object.

RhinoManager.Builder.setRequireEndpoint()

public RhinoManager.Builder setRequireEndpoint(boolean requireEndpoint)

Sets requireEndpoint of the Builder. 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).

Parameters

  • requireEndpoint boolean: Indicates whether an endpoint is required for Rhino to finish inference.

Returns

  • RhinoManager.Builder: Modified RhinoManager.Builder object.

RhinoManager.Builder.setErrorCallback()

public RhinoManager.Builder setErrorCallback(RhinoManagerErrorCallback errorCallback)

Sets errorCallback of the builder.

Parameters

  • errorCallback RhinoManagerErrorCallback : A function to run if errors occur while processing audio frames.

Returns

  • RhinoManager.Builder: Modified RhinoManager.Builder object.

RhinoManagerCallback

public interface RhinoManagerCallback {
void invoke(RhinoInference inference);
}

Callback interface invoked when inference has been finalized.


RhinoManagerErrorCallback

public interface RhinoManagerErrorCallback {
void invoke(RhinoException error);
}

Callback interface invoked when an error occurs while processing audio.

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Rhino Speech-to-Intent Android API
  • Rhino
  • delete()
  • getFrameLength()
  • getSampleRate()
  • getVersion()
  • getContextInformation()
  • process()
  • reset()
  • getInference()
  • Rhino.Builder
  • build()
  • setAccessKey()
  • setContextPath()
  • setModelPath()
  • setSensitivity()
  • setEndpointDurationSec()
  • setRequireEndpoint()
  • RhinoInference
  • getIsUnderstood()
  • getIntent()
  • getSlots()
  • RhinoException
  • RhinoManager
  • delete()
  • getVersion()
  • process()
  • getContextInformation()
  • RhinoManager.Builder
  • build()
  • setAccessKey()
  • setContextPath()
  • setModelPath()
  • setSensitivity()
  • setEndpointDurationSec()
  • setRequireEndpoint()
  • setErrorCallback()
  • RhinoManagerCallback
  • RhinoManagerErrorCallback
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.