Picovoice WordmarkPicovoice Console
Introduction
Introduction
AndroidC.NETFlutterlink to GoiOSJavaNvidia JetsonLinuxmacOSNodejsPythonRaspberry PiReact NativeRustWebWindows
AndroidC.NETFlutterlink to GoiOSJavaNodejsPythonReact NativeRustWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutterlink to GoiOSJavaNodejsPythonReact NativeRustWeb
AndroidC.NETFlutterlink to GoiOSJavaNodejsPythonReact NativeRustWeb
FAQ
Introduction
AndroidCiOSLinuxmacOSPythonWebWindows
AndroidCiOSPythonWeb
SummaryOctopus Speech-to-IndexGoogle Speech-to-TextMozilla DeepSpeech
FAQ
Introduction
AndroidAngularArduinoBeagleBoneCChrome.NETEdgeFirefoxFlutterlink to GoiOSJavaNvidia JetsonLinuxmacOSMicrocontrollerNodejsPythonRaspberry PiReactReact NativeRustSafariUnityVueWebWindows
AndroidAngularC.NETFlutterlink to GoiOSJavaMicrocontrollerNodejsPythonReactReact NativeRustUnityVueWeb
SummaryPorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidAngularBeagleBoneCChrome.NETEdgeFirefoxFlutterlink to GoiOSJavaNvidia JetsonlinuxmacOSNodejsPythonRaspberry PiReactReact NativeRustSafariUnityVueWebWindows
AndroidAngularC.NETFlutterlink to GoiOSJavaNodejsPythonReactReact NativeRustUnityVueWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidBeagleboneCiOSNvidia JetsonLinuxmacOSPythonRaspberry PiRustWebWindows
AndroidCiOSPythonRustWeb
SummaryPicovoice CobraWebRTC VAD
FAQ
Introduction
AndroidAngularArduinoBeagleBoneC.NETFlutterlink to GoiOSJavaNvidia JetsonMicrocontrollerNodejsPythonRaspberry PiReactReact NativeRustUnityVueWeb
AndroidAngularCMicrocontroller.NETFlutterlink to GoiOSJavaNodejsPythonReactReact NativeRustUnityVueWeb
Picovoice SDK - FAQ
IntroductionSTM32F407G-DISC1 (Arm Cortex-M4)STM32F411E-DISCO (Arm Cortex-M4)STM32F769I-DISCO (Arm Cortex-M7)IMXRT1050-EVKB (Arm Cortex-M7)
FAQGlossary

Leopard Speech-to-Text — .NET API


API Reference for the .NET Leopard SDK (NuGet)


namespace: Pv


Leopard

public class Leopard : IDisposable { }

Class for the Leopard Speech-to-Text engine.


Leopard.Create()

public static Leopard Create(
string accessKey,
string modelPath,
bool enableAutomaticPunctuation = false,)

Leopard constructor.

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console.
  • modelPath string : Absolute path to the file containing model parameters (.pv).
  • enableAutomaticPunctuation bool : Whether to enable automatic punctuation.

Returns

  • Leopard: An instance of Leopard Speech-To-Text engine.

Throws

  • LeopardException: If an error occurs while creating an instance of the Leopard Speech-to-Text engine.

Leopard.Process()

public LeopardTranscript Process(Int16[] pcm)

Processes given audio data and returns its transcription. The incoming audio needs to have a sample rate equal to .SampleRate() and be 16-bit linearly-encoded. Furthermore, Leopard operates on single channel audio. If you wish to process data in a different sample rate or format consider using .ProcessFile().

Parameters

  • pcm short[] : Audio data.

Returns

  • LeopardTranscript: object which contains the transcription results of the engine.

Throws

  • LeopardException: if there is an error while processing the audio frame.

Leopard.ProcessFile()

public LeopardTranscript ProcessFile(string audioPath)

Processes a given audio file and returns its transcription.

Parameters

  • audioPath string : Absolute path to the audio file. The supported audio file formats are: 3gp (AMR), FLAC , MP3, MP4/m4a (AAC), Ogg, WAV and WebM.

Returns

  • LeopardTranscript: object which contains the transcription results of the engine.

Throws

  • LeopardException: if there is an error while processing the audio file.

Leopard.SampleRate

public int SampleRate { get; private set; }

Getter for audio sample rate accepted by Picovoice.

Returns

  • int: Audio sample rate accepted by Picovoice.

Leopard.Version

public string Version { get; private set; }

Getter for version.

Returns

  • string: Current Leopard version.

LeopardTranscript

public class LeopardTranscript {
public LeopardTranscript(string transcriptString, LeopardWord[] wordArray)
}

Class that contains transcription results returned from Leopard.process() and Leopard.processFile().

Parameters

  • transcriptString String : Inferred transcription.
  • wordArray LeopardWord[] : Transcribed words and their associated metadata.

LeopardTranscript.TranscriptString

public string TranscriptString { }

Getter for the inferred transcription.

Returns

  • String: Inferred transcription.

LeopardTranscript.WordArray

public LeopardWord[] WordArray { }

Getter for transcribed words and their associated metadata.

Returns

  • LeopardWord[]: Transcribed words and their associated metadata.

LeopardWord

public class LeopardWord{
public LeopardWord(string word, float confidence, float startSec, float endSec)
}

Class for storing word metadata.

Parameters

  • word String : Transcribed word.
  • confidence float : Transcription confidence. It is a number within [0, 1].
  • startSec float : Start of word in seconds.
  • endSec float : End of word in seconds.

LeopardWord.Word

public string Word { get; private set; }

Getter for the transcribed word.

Returns

  • String: Transcribed word.

LeopardWord.Confidence

public string Confidence { get; private set; }

Getter for the transcription confidence.

Returns

  • float: Transcription confidence. It is a number within [0, 1].

LeopardWord.StartSec

public string StartSec { get; private set; }

Getter for the start of word in seconds.

Returns

  • float: Start of word in seconds.

LeopardWord.EndSec

public string EndSec { get; private set; }

Getter for the end of word in seconds.

Returns

  • float: End of word in seconds.

LeopardException

public class LeopardException : Exception

Exception thrown if an error occurs within Leopard Speech-to-Text engine.

Exceptions:

public class LeopardActivationException : LeopardException { }
public class LeopardActivationLimitException : LeopardException { }
public class LeopardActivationRefusedException : LeopardException { }
public class LeopardActivationThrottledException : LeopardException { }
public class LeopardIOException : LeopardException { }
public class LeopardInvalidArgumentException : LeopardException { }
public class LeopardInvalidStateException : LeopardException { }
public class LeopardKeyException : LeopardException { }
public class LeopardMemoryException : LeopardException { }
public class LeopardRuntimeException : LeopardException { }
public class LeopardStopIterationException : LeopardException { }

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Leopard Speech-to-Text — .NET API
  • Leopard
  • Create()
  • Process()
  • ProcessFile()
  • SampleRate
  • Version
  • LeopardTranscript
  • TranscriptString
  • WordArray
  • LeopardWord
  • Word
  • Confidence
  • StartSec
  • EndSec
  • LeopardException
Platform
  • Leopard Speech-to-Text
  • Cheetah Streaming Speech-to-Text
  • Octopus Speech-to-Index
  • Porcupine Wake Word
  • Rhino Speech-to-Intent
  • Cobra Voice Activity Detection
Resources
  • Docs
  • Console
  • Blog
  • Demos
Sales
  • Pricing
  • Starter Tier
  • Enterprise
Company
  • Careers
Follow Picovoice
  • LinkedIn
  • GitHub
  • Twitter
  • Medium
  • YouTube
  • AngelList
Subscribe to our newsletter
Terms of Use
Privacy Policy
© 2019-2022 Picovoice Inc.