rustLeopard - 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

Signup or Login to Picovoice Console to get your AccessKey. Make sure to keep your AccessKey secret.

Quick Start

Setup

  1. Download and install Rust.

  2. Add pv_leopard to the Cargo.toml manifest:

[dependencies]
pv_leopard = "*"

Usage

Create an instance of the engine:

use leopard::LeopardBuilder;
let access_key = "${ACCESS_KEY}"; // AccessKey obtained from Picovoice Console (https://console.picovoice.ai/)
let leopard: Leopard = LeopardBuilder::new(access_key)
.init()
.expect("Unable to create Leopard");

Transcribe an audio file:

if let Ok(transcript) = leopard.process_file("${AUDIO_PATH}") {
println!("{}", transcript);
}

Demo

For the Leopard Rust SDK, we offer demo applications that demonstrate how to use the Speech-to-Text engine on audio files.

Setup

Clone the Leopard repository from GitHub using HTTPS:

git clone --recurse-submodules https://github.com/Picovoice/leopard.git

Usage

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

leopard/demo/rust/filedemo
cargo run --release -- --help

Run the following command to transcribe an audio file:

cargo run --release -- --access_key ${ACCESS_KEY} --input_audio_path ${AUDIO_PATH}

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

Resources

Packages

API

GitHub

Benchmark


Issue with this doc? Please let us know.