rustRhino — Rust Quick Start


  • Linux (x86_64)
  • macOS (x86_64, arm64)
  • Windows (x86_64)
  • BeagleBone
  • NVIDIA Jetson Nano
  • Raspberry Pi (Zero, 2, 3, 4)


Picovoice Account & AccessKey

  1. Login or signup for a free account on the Picovoice Console.
  2. Go to the AccessKey tab to create one or use an existing AccessKey. Be sure to keep your AccessKey secret.

Quick Start


  1. Download and install Rust.

  2. Add pv_rhino to the Cargo.toml manifest:

pv_rhino = "*"


Create an instance of Rhino using either a pre-built context file (.rhn) from the Rhino GitHub Repository or a custom context created with the Picovoice Console:

use rhino::{Rhino, RhinoBuilder};
let rhino: Rhino = RhinoBuilder::new(
.expect("Unable to create Rhino");

Pass in frames of audio to the .process function:

fn next_audio_frame() -> Vec<i16> {
// ..
loop {
let audio_frame: Vec<i16> = next_audio_frame();
if let Ok(is_finalized) = rhino.process(&audio_frame) {
if is_finalized {
if let Ok(inference) = rhino.get_inference() {
if inference.is_understood {
let intent = inference.intent.unwrap();
let slots = inference.slots;
// take action based on inferred intent and slot values
} else {
// handle unsupported commands

Custom Contexts

Create custom context files using the Picovoice Console. Download the custom context file (.rhn) and pass it into the RhinoBuilder constructor.

Non-English Languages

Use the corresponding model file (.pv) to process non-English contexts. The model files for all supported languages are available on the Rhino GitHub repository.

Pass in the model file using the model_path builder method to change the detection language:

let rhino: Rhino = RhinoBuilder::new(
.expect("Unable to create Rhino");


For the Rhino Rust SDK, we offer demo applications that demonstrate how to use the Speech-to-Intent engine on real-time audio streams (i.e. microphone input) and audio files.


Clone the Rhino GitHub Repository:

git clone --recurse-submodules


Use the --help flag to see the usage options for the demo:

cd rhino/demo/rust/micdemo
cargo run --release -- --help

Ensure you have a working microphone connected to your system and run the following command to make inferences based on the given context file:

cargo run --release -- --access_key "${ACCESS_KEY}" --context_path "${CONTEXT_FILE_PATH}"

For more information on our Rhino demos for Rust, head over to our GitHub repository.






Issue with this doc? Please let us know.