Skip to content

Latest commit

 

History

History
86 lines (60 loc) · 2.52 KB

README.md

File metadata and controls

86 lines (60 loc) · 2.52 KB

Leopard Speech-to-Text Demos

Made in Vancouver, Canada by Picovoice

Leopard

Leopard is an on-device speech-to-text engine. Leopard is:

  • Private; All voice processing runs locally.
  • Accurate
  • Compact and Computationally-Efficient
  • Cross-Platform:
    • Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64)
    • Android and iOS
    • Chrome, Safari, Firefox, and Edge
    • Raspberry Pi (3, 4, 5)

Compatibility

  • Rust 1.54+
  • Runs on Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64), and Raspberry Pi (3, 4, 5).

Installation

First you will need Rust and Cargo installed on your system.

To add the leopard library into your app, add pv_leopard to your apps Cargo.toml manifest:

[dependencies]
pv_leopard = "*"

If you prefer to clone the repo and use it locally, first run copy.sh. (NOTE: on Windows, Git Bash or another bash shell is required, or you will have to manually copy the libs into the project). Then you can reference the local binding location:

[dependencies]
pv_leopard = { path = "/path/to/rust/binding" }

AccessKey

Leopard requires a valid Picovoice AccessKey at initialization. AccessKey acts as your credentials when using Leopard SDKs. You can get your AccessKey for free. Make sure to keep your AccessKey secret. Signup or Login to Picovoice Console to get your AccessKey.

Usage

NOTE: The working directory for the following Cargo commands is:

leopard/demo/rust/filedemo  # File Demo
leopard/demo/rust/micdemo   # Microphone Demo

File Demo

Run the following in the terminal:

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

Replace ${ACCESS_KEY} with yours obtained from Picovoice Console and ${AUDIO_FILE_PATH} with a path to an audio file you wish to transcribe.

Microphone Demo

You need a working microphone connected to your machine for this demo. Run the following in the terminal:

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

Replace ${ACCESS_KEY} with yours obtained from Picovoice Console. Once running, the demo prints:

>>> Press `ENTER` to start:

Press ENTER key and wait for the following message in the terminal:

>>> Recording ... Press `ENTER` to stop:

Now start recording and when done press ENTER key to get the transcription.