Cheetah - Rust Quick Start
Platforms
- Linux (x86_64)
- macOS (x86_64, arm64)
- Windows (x86_64)
- NVIDIA Jetson Nano
- Raspberry Pi (3, 4)
Requirements
- Picovoice Account & AccessKey
- Rust 1.54+
- Cargo
Picovoice Account & AccessKey
Signup or Login to Picovoice Console to get your AccessKey
.
Make sure to keep your AccessKey
secret.
Quick Start
Setup
Download and install Rust.
Add
pv_cheetah
to theCargo.toml
manifest:
[dependencies]pv_cheetah = "*"
Usage
Create an instance of the engine and transcribe audio:
use cheetah::CheetahBuilder;let access_key = "${ACCESS_KEY}"; // AccessKey obtained from Picovoice Console (https://console.picovoice.ai/)let cheetah: Cheetah = CheetahBuilder::new(access_key).init().expect("Unable to create Cheetah");fn next_audio_frame() -> Vec<i16> {// get audio frame}if let Ok(cheetahTranscript) = cheetah.process(&next_audio_frame()) {println!("{}", cheetahTranscript.transcript)if cheetahTranscript.is_endpoint {if let Ok(cheetahTranscript) = cheetah.flush() {println!("{}", cheetahTranscript.transcript)}}}
Demo
For the Cheetah Rust SDK, we offer demo applications that demonstrate how to use the Speech-to-Text engine on real-time audio streams (i.e. microphone input)..
Setup
Clone the Cheetah repository from GitHub using HTTPS:
git clone --recurse-submodules https://github.com/Picovoice/cheetah.git
Usage
Use the --help
flag to see the usage options for the demo:
cheetah/demo/rust/micdemocargo run --release -- --help
Run the following command to transcribe real-time audio:
cargo run --release -- --access_key ${ACCESS_KEY}
For more information on our Cheetah demos for Rust, head over to our GitHub repository.