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

Porcupine Wake Word — .NET API


API Reference for the .NET Porcupine SDK (NuGet)


namespace: Pv


Porcupine

public class Porcupine : IDisposable { }

Class for the Porcupine Wake Word engine.


Porcupine.FromBuiltInKeywords()

public static Porcupine FromBuiltInKeywords(
string accessKey,
IEnumerable<BuiltInKeyword> keywords,
string modelPath = null,
IEnumerable<float> sensitivities = null)

Porcupine constructor when using built-in keywords.

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console.
  • keywords IEnumerable<BuiltInKeyword> : List of built-in keywords for detection.
  • modelPath string : Absolute path to the file containing model parameters (.pv).
  • sensitivities IEnumerable<float> : Sensitivities for detecting keywords. Each value should be a number within [0, 1].

Returns

  • Porcupine: An instance of Porcupine Wake Word engine.

Throws

  • PorcupineException: If an error occurs while creating an instance of Porcupine Wake Word engine.

Porcupine.FromKeywordPaths()

public static Porcupine FromKeywordPaths(
string accessKey,
IEnumerable<string> keywordPaths,
string modelPath = null,
IEnumerable<float> sensitivities = null)

Porcupine constructor when using keyword paths.

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console.
  • keywordPaths IEnumerable<string> : List of absolute paths to keyword model files.
  • modelPath string : Absolute path to the file containing model parameters (.pv).
  • sensitivities IEnumerable<float> : Sensitivities for detecting keywords. Each value should be a number within [0, 1].

Returns

  • Porcupine: An instance of Porcupine Wake Word engine.

Throws

  • PorcupineException: If an error occurs while creating an instance of Porcupine Wake Word engine.

Porcupine.Process()

public int 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. Porcupine operates on single-channel audio.

Parameters

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

Returns

  • int: Index of observed keyword at the end of the current frame. Indexing is 0-based and matches the ordering of keyword models provided to the constructor. If no keyword is detected then it returns -1.

Throws

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

Porcupine.FrameLength

public int FrameLength { get; private set; }

Getter for number of audio samples per frame.

Returns

  • int: Number of audio samples per frame.

Porcupine.SampleRate

public int SampleRate { get; private set; }

Getter for audio sample rate accepted by Picovoice.

Returns

  • int: Audio sample rate accepted by Picovoice.

Porcupine.Version

public string Version { get; private set; }

Getter for version.

Returns

  • String: Current Porcupine version.

BuiltInKeyword

public enum BuiltInKeyword
{
ALEXA,
AMERICANO,
BLUEBERRY,
BUMBLEBEE,
COMPUTER,
GRAPEFRUIT,
GRASSHOPPER,
HEY_GOOGLE,
HEY_SIRI,
JARVIS,
OK_GOOGLE,
PICOVOICE,
PORCUPINE,
TERMINATOR
}

List of available built-in wake words.


PorcupineException

public class PorcupineException : Exception { }

Exception thrown if an error occurs within Porcupine Wake Word engine.

Exceptions:

public class PorcupineMemoryException : PorcupineException { }
public class PorcupineIOException : PorcupineException { }
public class PorcupineInvalidArgumentException : PorcupineException { }
public class PorcupineStopIterationException : PorcupineException { }
public class PorcupineKeyException : PorcupineException { }
public class PorcupineInvalidStateException : PorcupineException { }
public class PorcupineRuntimeException : PorcupineException { }
public class PorcupineActivationException : PorcupineException { }
public class PorcupineActivationLimitException : PorcupineException { }
public class PorcupineActivationThrottledException : PorcupineException { }
public class PorcupineActivationRefusedException : PorcupineException { }

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Porcupine Wake Word — .NET API
  • Porcupine
  • FromBuiltInKeywords()
  • FromKeywordPaths()
  • Process()
  • FrameLength
  • SampleRate
  • Version
  • BuiltInKeyword
  • PorcupineException
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.