csharpPicovoice Platform — .NET API

API Reference for the .NET Picovoice SDK (NuGet)

namespace: Pv


public class Picovoice : IDisposable { }

Class for Picovoice.


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,
bool requireEndpoint = true)

Picovoice constructor.


  • 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].
  • requireEndpoint bool : If set to true, Rhino requires an endpoint (chunk of silence) before finishing inference.



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


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.


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



public string ContextInfo { get; private set; }

Getter for Rhino context information.


  • string: Returns the Rhino context information.


public int FrameLength { get; private set; }

Getter for number of audio samples per frame.


  • int: Number of audio samples per frame.


public int SampleRate { get; private set; }

Getter for audio sample rate accepted by Picovoice.


  • int: Audio sample rate accepted by Picovoice.


public string Version { get; private set; }

Getter for version.



public class PicovoiceException extends Exception { }

Exception thrown if an error occurs within the Picovoice platform.


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 { }

Issue with this doc? Please let us know.