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

Picovoice Platform — .NET API


API Reference for the .NET Picovoice SDK (NuGet)


namespace: Pv


Picovoice

public class Picovoice : IDisposable { }

Class for Picovoice.


Picovoice.Create()

public static Rhino Create(
string accessKey,
string keywordPath,
Action wakeWordCallback,
string contextPath,
Action<Inference> inferenceCallback,
string porcupineModelPath = null,
float porcupineSensitivity = 0.5f,
string rhinoModelPath = null,
float rhinoSensitivity = 0.5f,
float endpointDurationSec = 1.0f,
bool requireEndpoint = true)

Picovoice constructor.

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console.
  • keywordPath string : Absolute path to a Porcupine keyword model file (.ppn).
  • wakeWordCallback Action : User-defined callback invoked upon detection of the keyword phrase.
  • contextPath string : Absolute path to a Rhino context file (.rhn).
  • inferenceCallback Action<Inference> : User-defined callback invoked upon completion of intent inference. Has a single argument of type Inference.
  • porcupineModelPath string : Absolute path to the file containing Porcupine model parameters (.pv).
  • porcupineSensitivity float : Keyword sensitivity. It should be a number within [0, 1].
  • rhinoModelPath string : Absolute path to the file containing Rhino model parameters (.pv).
  • rhinoSensitivity float : Inference sensitivity. It should be a number within [0, 1].
  • endpointDurationSec float : Endpoint duration in seconds. An endpoint is a chunk of silence at the end of an utterance that marks the end of spoken command. It should be a positive number within [0.5, 5]. A lower endpoint duration reduces delay and improves responsiveness. A higher endpoint duration assures Rhino doesn't return inference pre-emptively in case the user pauses before finishing the request.
  • requireEndpoint bool : If set to true, Rhino requires an endpoint (a chunk of silence) after the spoken command. If set to false, Rhino tries to detect silence, but if it cannot, it still will provide inference regardless. Set to false only if operating in an environment with overlapping speech (e.g. people talking in the background).

Returns

  • Picovoice: An instance of Picovoice.

Throws

  • PicovoiceException: If an error occurs while creating an instance of the Picovoice platform.

Picovoice.Process()

public void Process(short[] pcm)

Processes a frame of the incoming audio stream and emits the detection result. The number of samples per frame can be attained by calling .FrameLength. The incoming audio needs to have a sample rate equal to .SampleRate and be 16-bit linearly-encoded. Picovoice operates on single-channel audio.

Parameters

  • pcm short[] : A frame of audio samples.

Throws

  • PicovoiceException: If there is an error while processing the audio frame.

Picovoice.ContextInfo

public string ContextInfo { get; private set; }

Getter for Rhino context information.

Returns

  • string: Returns the Rhino context information.

Picovoice.FrameLength

public int FrameLength { get; private set; }

Getter for number of audio samples per frame.

Returns

  • int: Number of audio samples per frame.

Picovoice.SampleRate

public int SampleRate { get; private set; }

Getter for audio sample rate accepted by Picovoice.

Returns

  • int: Audio sample rate accepted by Picovoice.

Picovoice.Version

public string Version { get; private set; }

Getter for version.

Returns

  • string: Current Picovoice version.

PicovoiceException

public class PicovoiceException extends Exception { }

Exception thrown if an error occurs within the Picovoice platform.

Exceptions:

public class PicovoiceActivationException extends PicovoiceException { }
public class PicovoiceActivationLimitException extends PicovoiceException { }
public class PicovoiceActivationRefusedException extends PicovoiceException { }
public class PicovoiceActivationThrottledException extends PicovoiceException { }
public class PicovoiceIOException extends PicovoiceException { }
public class PicovoiceInvalidArgumentException extends PicovoiceException { }
public class PicovoiceInvalidStateException extends PicovoiceException { }
public class PicovoiceKeyException extends PicovoiceException { }
public class PicovoiceMemoryException extends PicovoiceException { }
public class PicovoiceRuntimeException extends PicovoiceException { }
public class PicovoiceStopIterationException extends PicovoiceException { }

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Picovoice Platform — .NET API
  • Picovoice
  • Create()
  • Process()
  • ContextInfo
  • FrameLength
  • SampleRate
  • Version
  • PicovoiceException
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.