csharpLeopard - .NET Quick Start

Platforms

  • Linux (x86_64)
  • macOS (x86_64)
  • Windows (x86_64)
  • NVIDIA Jetson Nano
  • Raspberry Pi (3, 4)

Requirements

.NET Framework 4.6.1+ / .NET Standard 2.0+ / .NET Core 3.1+:

  • Windows (x86_64)

.NET Core 2.0+ / .NET Core 3.1+:

  • Linux (x86_64)
  • macOS (x86_64)

.NET Core 3.1+:

  • NVIDIA Jetson Nano
  • Raspberry Pi (3, 4)

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 .NET.

  2. Install the Leopard NuGet package in Visual Studio or using the .NET CLI:

dotnet add package Leopard

Usage

Create an instance of the engine:

using Pv;
const string accessKey = "${ACCESS_KEY}";
Leopard leopard = Leopard.Create(accessKey);

Transcribe an audio file by providing an absolute path to the file:

string transcript = leopard.ProcessFile("${AUDIO_FILE_PATH}");

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

short[] GetAudioData()
{
// ...
}
string transcript = leopard.Process(GetAudioData());

Demo

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

Setup

  1. Clone the Leopard repository from GitHub:
git clone --recurse-submodules https://github.com/Picovoice/leopard.git
  1. Build the demo:
cd leopard/demo/dotnet/Leopard
dotnet build -c FileDemo.Release

Usage

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

dotnet run -c FileDemo.Release -- --help

Run the following command to transcribe an audio file:

dotnet run -c FileDemo.Release -- --access_key ${ACCESS_KEY}
--input_audio_path ${AUDIO_PATH}

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

Resources

Packages

API

GitHub

Benchmark


Issue with this doc? Please let us know.