pythonLeopard - Python 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. Install Python 3.

  2. Install the pvleopard Python package using PIP:

pip3 install pvleopard

Usage

Create an instance of the engine and transcribe an audio file:

import pvleopard
leopard = pvleopard.create(access_key='${ACCESS_KEY}')
print(leopard.process_file('${AUDIO_PATH}'))

Transcribe raw audio data (sample rate of 16 kHz, 16-bit linearly encoded and 1 channel):

def getAudioData():
// get audio data
print(leopard.process(getAudioData()))

Free resources used by Leopard:

leopard.delete();

Demo

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

Setup

Install the pvleoparddemo Python package using PIP:

pip3 install pvleoparddemo

This package installs command-line utilities for the Leopard Python demos.

Usage

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

leopard_demo_file --help

Run the following command to transcribe an audio file:

leopard_demo_file --access_key ${ACCESS_KEY} \
--audioPaths ${AUDIO_PATH1} ${AUDIO_PATH2} ...

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

Resources

Packages

API

GitHub

Benchmark


Issue with this doc? Please let us know.