csharpCheetah - .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 Cheetah NuGet package in Visual Studio or using the .NET CLI:

dotnet add package Picovoice.Cheetah

Usage

Create an instance of the engine:

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

Transcribe audio:

short[] GetNextAudioFrame()
{
// .. get audioFrame
return audioFrame;
}
string transcript = "";
while(true)
{
CheetahTranscript transcriptObj = cheetah.Process(GetNextAudioFrame());
transcript += transcriptObj.Transcript;
if (transcriptObj.IsEndpoint) {
CheetahTranscript finalTranscriptObj = cheetah.Flush();
transcript += finalTranscriptObj.Transcript;
}
}

Demo

For the Cheetah .NET 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

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

Usage

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

dotnet run -c MicDemo.Release -- --help

Ensure you have a working microphone connected to your system and run the following command to perform live speech-to-text:

dotnet run -c MicDemo.Release -- --access_key ${ACCESS_KEY}

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

Resources

Packages

API

GitHub

Benchmark


Issue with this doc? Please let us know.