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
AndroidCiOSPythonWeb
AndroidCiOSPythonWeb
SummaryPicovoice KoalaMozilla RNNoise
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 — Node.js API


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


Picovoice

class Picovoice

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


Picovoice.constructor()

Picovoice.constructor(
accessKey,
keywordPath,
wakeWordCallback,
contextPath,
inferenceCallback,
porcupineSensitivity = 0.5,
rhinoSensitivity = 0.5,
endpointDurationSec = 1.0,
requireEndpoint = true,
porcupineModelPath,
rhinoModelPath,
porcupineLibraryPath,
rhinoLibraryPath
)

constructor method for Picovoice.

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console .
  • keywordPath string : Absolute paths to keyword model files.
  • wakeWordCallback (index) => {} : User-defined callback invoked upon detection of the wake phrase. Receives an index number.
  • contextPath string : The path to the Rhino context file (.rhn extension).
  • inferenceCallback (inference) => {} : User-defined callback invoked upon completion of intent inference. Receives an inference object.
  • porcupineSensitivity number : Wake word detection sensitivity. It should be a number within [0, 1]. A higher sensitivity results in fewer misses at the cost of increasing the false alarm rate.
  • rhinoSensitivity number : Inference sensitivity. It should be a number within [0, 1]. A higher sensitivity results in fewer misses at the cost of increasing the false alarm rate.
  • endpointDurationSec number : 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 boolean : 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). Default value is true.
  • porcupineModelPath string : Absolute path to the file containing Porcupine's model parameters.
  • rhinoModelPath string : Absolute path to the file containing Rhino's model parameters.
  • porcupineLibraryPath string : The path to the Porcupine dynamic library (platform-dependent extension).
  • rhinoLibraryPath string : The path to the Rhino dynamic library (platform-dependent extension).

Returns

  • Picovoice: An instance of Picovoice.

Picovoice.frameLength

Picovoice.frameLength

The number of audio samples per frame.


Picovoice.sampleRate

Picovoice.sampleRate

The audio sample rate accepted by Picovoice.


Picovoice.version

Picovoice.version

The version of the Picovoice SDK.


Picovoice.porcupineVersion

Picovoice.porcupineVersion

The version of the Porcupine SDK.


Picovoice.rhinoVersion

Picovoice.rhinoVersion

The version of the Rhino SDK.


Picovoice.contextInfo

Picovoice.contextInfo

The context information.


Picovoice.process()

Picovoice.process(frame)

Processes a frame of the incoming audio stream. Upon detection of wake word and completion of follow-on command inference invokes user-defined callbacks. 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

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

Picovoice.release()

Picovoice.release()

Releases resources acquired by Picovoice.

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Picovoice Platform — Node.js API
  • Picovoice
  • Picovoice.constructor()
  • frameLength
  • sampleRate
  • version
  • porcupineVersion
  • rhinoVersion
  • contextInfo
  • Picovoice.process()
  • Picovoice.release()
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.