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
Node.js API

API Reference for the Node.js Porcupine SDK (npmjs).


Porcupine

class Porcupine

Class for the Porcupine wake word engine. Porcupine can be initialized using the class constructor(). Resources should be cleaned when you are done using the release() method.


Porcupine.constructor()

Porcupine.constructor(
accessKey,
keywords,
sensitivities,
manualModelPath,
manualLibraryPath
)

constructor method for Porcupine wake word engine.

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console.
  • keywords Array<string> : Absolute paths to keyword model files.
  • sensitivities Array<number> : 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.
  • manualModelPath string : Absolute path to the file containing model parameters.
  • manualLibraryPath string : Absolute path to Porcupine's dynamic library.

Returns

  • Porcupine: An instance of Porcupine wake word engine.

Porcupine.process()

Porcupine.process(frame)

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

  • frame Array<number> : A frame of audio samples.

Returns

  • number : 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.

Porcupine.frameLength

Porcupine.frameLength

The number of audio samples per frame.


Porcupine.sampleRate

Porcupine.sampleRate

The audio sample rate accepted by the Porcupine engine.


Porcupine.version

Porcupine.version

The version of the Porcupine engine.


Porcupine.release()

Porcupine.release()

Releases resources acquired by Porcupine


Errors

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

Exceptions:

class PvStatusOutOfMemoryError extends Error {}
class PvStatusIoError extends Error {}
class PvStatusInvalidArgumentError extends Error {}
class PvStatusStopIterationError extends Error {}
class PvStatusKeyError extends Error {}
class PvStatusInvalidStateError extends Error {}
class PvStatusRuntimeError extends Error {}
class PvStatusActivationError extends Error {}
class PvStatusActivationLimitReached extends Error {}
class PvStatusActivationThrottled extends Error {}
class PvStatusActivationRefused extends Error {}

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Porcupine Wake Word Node.js API
  • Porcupine
  • constructor()
  • process()
  • frameLength
  • sampleRate
  • version
  • release()
  • Errors
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.