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

Cheetah Speech-to-Text
Rust API

Rust SDKs will no longer be maintained after July 15, 2025. If you plan to use the Cheetah Speech-to-Text Rust SDK for commercial purposes, please contact us.

API Reference for the Cheetah Rust SDK (crates.io).


cheetah::Cheetah

pub struct Cheetah

Struct for the Cheetah Speech-to-Text engine.


cheetah::Cheetah.process()

pub fn process(&self, pcm: &[i16]) -> Result<CheetahTranscript, CheetahError>

Processes a frame of audio and returns newly-transcribed text and a flag indicating if an endpoint has been detected. Upon detection of an endpoint, the client may invoke .flush() to retrieve any remaining transcription.

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. Furthermore, Cheetah operates on single-channel audio.

Parameters

  • pcm &[i16] : Audio data.

Returns

  • Result<CheetahTranscript, CheetahError> : If Ok, returns the inferred transcription as a CheetahTranscript object. If Err, a CheetahError object describing the error that was encountered.

cheetah::Cheetah.flush()

pub fn flush(&self) -> Result<CheetahTranscript, CheetahError>

Marks the end of the audio stream, flushes internal state of the object, and returns any remaining transcribed text.

Returns

  • Result<CheetahTranscript, CheetahError> : If Ok, returns the remaining inferred transcription as a CheetahTranscript object. If Err, a CheetahError object describing the error that was encountered.

cheetah::Cheetah.frame_length()

pub fn frame_length(&self) -> u32

Gets the frame length.

Returns

  • u32 : Audio frame length accepted by Cheetah.

cheetah::Cheetah.sample_rate()

pub fn sample_rate(&self) -> u32

Gets the sample rate.

Returns

  • u32 : Audio sample rate accepted by Cheetah.

cheetah::Cheetah.version()

pub fn version(&self) -> &str

Gets the Cheetah version.

Returns

  • &str : Cheetah version string.

cheetah::CheetahBuilder

pub struct CheetahBuilder

Builder struct for creating an instance of Cheetah.


cheetah::CheetahBuilder.new()

pub fn new() -> Self

Creates a new CheetahBuilder.

Returns

  • CheetahBuilder : A new Builder object.

cheetah::CheetahBuilder.access_key()

pub fn access_key<S: Into<String>>(&mut self, access_key: S) -> &mut Self

Modifies the access_key of a CheetahBuilder object.

Parameters

  • access_key S : AccessKey obtained from Picovoice Console.

Returns

  • CheetahBuilder : The modified Builder object.

cheetah::CheetahBuilder.model_path()

pub fn model_path<P: Into<PathBuf>>(&mut self, model_path: P) -> &mut Self

Modifies the model_path of a CheetahBuilder object.

Parameters

  • model_path P : Path to the file containing model parameters (.pv).

Returns

  • CheetahBuilder : The modified Builder object.

cheetah::CheetahBuilder.library_path()

pub fn library_path<P: Into<PathBuf>>(&mut self, library_path: P) -> &mut Self

Modifies the library_path of a CheetahBuilder object.

Parameters

  • library_path P : Path to the Cheetah library file.

Returns

  • CheetahBuilder : The modified Builder object.

cheetah::CheetahBuilder.endpoint_duration_sec()

pub fn endpoint_duration_sec(&mut self, endpoint_duration_sec: f32) -> &mut Self

Modifies the endpoint_duration_sec of a CheetahBuilder object.

Parameters

  • endpoint_duration_sec f32 : Duration of endpoint in seconds. A speech endpoint is detected when there is a segment of audio (with a duration specified herein) after an utterance without any speech in it. Set to 0 to disable endpoint detection.

Returns

  • CheetahBuilder : The modified Builder object.

cheetah::CheetahBuilder.enable_automatic_punctuation()

pub fn enable_automatic_punctuation(&mut self, enable_automatic_punctuation: bool) -> &mut Self

Modifies the enable_automatic_punctuation of a CheetahBuilder object.

Parameters

  • enable_automatic_punctuation bool : Set to true to enable automatic punctuation insertion.

Returns

  • CheetahBuilder : The modified Builder object.

cheetah::CheetahBuilder.init()

pub fn init(&self) -> Result<Cheetah, CheetahError>

Creates an instance of Cheetah from the CheetahBuilder object.

Returns

  • Result<Cheetah, CheetahError> : If Ok, an initialized instance of Cheetah. If Err, an instance of CheetahError detailing the error that was encountered.

cheetah::CheetahTranscript

pub struct CheetahTranscript {
pub transcript: String,
pub is_endpoint: bool,
}

Struct containing transcript information returned by the Cheetah Rust SDK.

Properties

  • transcript String : Any transcribed speech (if none, then an empty string is returned).
  • is_endpoint bool : A flag indicating if an endpoint has been detected.

cheetah::CheetahError

pub struct CheetahError

An error type describing any errors encountered by the Cheetah SDK.


cheetah::CheetahError.new()

pub fn new(status: CheetahErrorStatus, message: impl Into<String>) -> Self

Creates a new instance of CheetahError

Parameters

  • status CheetahErrorStatus : Type of error encountered.
  • message impl Into<String> : Message detailing the cause of the error.

cheetah::CheetahErrorStatus

pub enum CheetahErrorStatus {
LibraryError(PvStatus),
LibraryLoadError,
FrameLengthError,
ArgumentError,
}

Enum describing possible error types returned from the Cheetah Rust SDK.


cheetah::PvStatus

pub enum PvStatus {
SUCCESS,
OUT_OF_MEMORY,
IO_ERROR,
INVALID_ARGUMENT,
STOP_ITERATION,
KEY_ERROR,
INVALID_STATE,
RUNTIME_ERROR,
ACTIVATION_ERROR,
ACTIVATION_LIMIT_REACHED,
ACTIVATION_THROTTLED,
ACTIVATION_REFUSED,
}

Error codes returned from the Cheetah library.

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Cheetah Speech-to-Text Rust API
  • cheetah::Cheetah
  • process()
  • flush()
  • frame_length()
  • sample_rate()
  • version()
  • cheetah::CheetahBuilder
  • new()
  • access_key()
  • model_path()
  • library_path()
  • endpoint_duration_sec()
  • enable_automatic_punctuation()
  • init()
  • cheetah::CheetahTranscript
  • cheetah::CheetahError
  • new()
  • cheetah::CheetahErrorStatus
  • cheetah::PvStatus
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.