Picovoice Wordmark
Start Building
Introduction
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryPicovoice picoLLMGPTQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-TextWhisper Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustWeb
SummaryPicovoice Cheetah
FAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryAmazon PollyAzure TTSElevenLabsOpenAI TTSPicovoice Orca
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice KoalaMozilla RNNoise
Introduction
AndroidCiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidCNode.jsPythoniOSWeb
SummaryPicovoice EaglepyannoteSpeechBrainWeSpeaker
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice FalconAmazon TranscribeAzure Speech-to-TextGoogle Speech-to-Textpyannote
Introduction
AndroidArduinoCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSMicrocontrollerNode.jsPythonRaspberry PiReactReact NativeRustSafariUnityWebWindows
AndroidC.NETFlutteriOSJavaMicrocontrollerNode.jsPythonReactReact NativeRustUnityWeb
SummaryPorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustSafariUnityWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustUnityWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiRustWebWindows
AndroidC.NETiOSNode.jsPythonRustWeb
SummaryPicovoice CobraWebRTC VAD
FAQ
Introduction
AndroidC.NETFlutteriOSNode.jsPythonReact NativeRustUnityWeb
AndroidC.NETFlutteriOSNode.jsPythonReact NativeRustUnityWeb
Introduction
C.NETNode.jsPython
C.NETNode.jsPython
FAQGlossary

Porcupine Wake Word
Unity API

Unity SDKs will no longer be maintained after December 15, 2025. If you plan to use the Porcupine Wake Word Unity SDK for commercial purposes, please contact us.

API Reference for the Porcupine Unity SDK.


package: Pv.Unity


Porcupine

public class Porcupine : IDisposable

Class for the Porcupine Wake Word engine.


Porcupine.BuiltInKeyword

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

Keywords that are packaged with the Porcupine Unity SDK.


Porcupine.FrameLength

public int FrameLength { get; }

Gets the required number of audio samples-per-frame.

Returns

  • int : Required frame length.

Porcupine.SampleRate

public int SampleRate { get; }

Get the audio sample rate required by Porcupine.

Returns

  • int : Required sample rate in Hz.

Porcupine.Version

public string Version { get; }

Gets the version number of the Porcupine library.

Returns

  • string : Version of Porcupine.

Porcupine.Dispose()

public void Dispose()

Explicitly releases resources acquired by Porcupine.


Porcupine.FromBuiltInKeywords()

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

Creates an instance of Porcupine from built-in keywords.

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console.
  • keywords IEnumerable<BuiltInKeyword> : List of built-in keywords to detect.
  • modelPath string : Absolute path to the file containing model parameters (.pv). If not set, default model is used.
  • sensitivities IEnumerable<float> : Sensitivities for detecting keywords. Each value should be a number within [0, 1]. A higher sensitivity results in fewer misses at the cost of increasing the false alarm rate. Default values are 0.5.

Returns

  • Porcupine : An instance of the 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)

Creates an instance of Porcupine from custom keyword files.

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console.
  • keywordPaths IEnumerable<string> : A list of absolute paths to keyword model files (.ppn).
  • modelPath string : Absolute path to the file containing model parameters (.pv). If not set, default model is used.
  • sensitivities IEnumerable<float> : Sensitivities for detecting keywords. Each value should be a number within [0, 1]. A higher sensitivity results in fewer misses at the cost of increasing the false alarm rate. Default values are 0.5.

Returns

  • Porcupine : An instance of the 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 obtained 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 keywords provided to the Porcupine instance. If no keyword is detected then it returns -1.

Throws

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

PorcupineException

public class PorcupineException : Exception

Exception thrown if an error is encountered by the Porcupine engine.

Exceptions:

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

PorcupineManager

public class PorcupineManager

High-level API for the Porcupine Wake Word engine. It handles audio recording and processing in real-time, and notifies the client upon detection of the wake word.


PorcupineManager.IsAudioDeviceAvailable

public bool IsAudioDeviceAvailable { get; }

Checks whether there are any audio capture devices available.

Returns

  • bool : If any available audio capture device are available.

PorcupineManager.IsRecording

public bool IsRecording { get; }

Checks whether PorcupineManager is capturing audio or not.

Returns

  • bool : If recording or not.

PorcupineManager.Delete()

public void Delete()

Free resources that were allocated to PorcupineManager.


PorcupineManager.FromBuiltInKeywords()

public static PorcupineManager FromBuiltInKeywords(
string accessKey,
IEnumerable<BuiltInKeyword> keywords,
Action<int> wakeWordCallback,
string modelPath = null,
IEnumerable<float> sensitivities = null,
Action<PorcupineException> processErrorCallback = null)

Creates an instance of PorcupineManager from built-in keywords.

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console.
  • keywords IEnumerable<BuiltInKeyword> : List of built-in keywords to detect.
  • wakeWordCallback Action<int> : A callback that is triggered when one of the given keywords has been detected by Porcupine.
  • modelPath string : Absolute path to the file containing model parameters (.pv). If not set, default model is used.
  • sensitivities IEnumerable<float> : Sensitivities for detecting keywords. Each value should be a number within [0, 1]. A higher sensitivity results in fewer misses at the cost of increasing the false alarm rate. Default values are 0.5.
  • processErrorCallback Action<PorcupineException> : Callback that triggers is the engine experiences a problem while processing audio. If not set, errors will be printed to the Debug console.

Returns

  • PorcupineManager : An instance of the PorcupineManager class.

Throws

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

PorcupineManager.FromKeywordPaths()

public static PorcupineManager FromKeywordPaths(
string accessKey,
IEnumerable<string> keywordPaths,
Action<int> wakeWordCallback,
string modelPath = null,
IEnumerable<float> sensitivities = null,
Action<PorcupineException> processErrorCallback = null)

Creates an instance of PorcupineManager from a list of Porcupine keyword file paths.

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console.
  • keywordPaths IEnumerable<string> : A list of absolute paths to keyword model files (.ppn).
  • wakeWordCallback Action<int> : A callback that is triggered when one of the given keywords has been detected by Porcupine.
  • modelPath string : Absolute path to the file containing model parameters (.pv). If not set, default model is used.
  • sensitivities IEnumerable<float> : Sensitivities for detecting keywords. Each value should be a number within [0, 1]. A higher sensitivity results in fewer misses at the cost of increasing the false alarm rate. Default values are 0.5.
  • processErrorCallback Action<PorcupineException> : Callback that triggers is the engine experiences a problem while processing audio. If not set, errors will be printed to the Debug console.

Returns

  • PorcupineManager : An instance of the PorcupineManager class.

Throws

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

PorcupineManager.Start()

public void Start()

Starts audio capture and wake word detection.

Throws

  • PorcupineException : If there is an error while starting audio capture.

PorcupineManager.Stop()

public void Start()

Stops audio capture and wake word detection.

Throws

  • PorcupineException : If there is an error while stopping audio capture.

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Porcupine Wake Word Unity API
  • Porcupine
  • BuiltInKeyword
  • FrameLength
  • SampleRate
  • Version
  • Dispose()
  • FromBuiltInKeywords()
  • FromKeywordPaths()
  • Process()
  • PorcupineException
  • PorcupineManager
  • IsAudioDeviceAvailable
  • IsRecording
  • Delete()
  • FromBuiltInKeywords()
  • FromKeywordPaths()
  • Start()
  • Stop()
Voice AI
  • Leopard Speech-to-Text
  • Cheetah Streaming Speech-to-Text
  • Orca Text-to-Speech
  • Koala Noise Suppression
  • Eagle Speaker Recognition
  • Falcon Speaker Diarization
  • Porcupine Wake Word
  • Rhino Speech-to-Intent
  • Cobra Voice Activity Detection
Local LLM
  • picoLLM Inference
  • picoLLM Compression
  • picoLLM GYM
Resources
  • Docs
  • Console
  • Blog
  • Use Cases
  • Playground
Sales & Services
  • Consulting
  • Foundation Plan
  • Enterprise Plan
  • Enterprise Support
Company
  • About us
  • Careers
Follow Picovoice
  • LinkedIn
  • GitHub
  • X
  • YouTube
  • AngelList
Subscribe to our newsletter
Terms of Use
Privacy Policy
© 2019-2025 Picovoice Inc.