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

Voice Processor
Web API

API Reference for the Voice Processor Web SDK (npmjs).


PvEngine

type PvEngine = {
onmessage?: ((e: MessageEvent) => any) | null;
postMessage?: (e: any) => void;
worker?: {
onmessage?: ((e: MessageEvent) => any) | null;
postMessage?: (e: any) => void;
}
}

Type that represents an engine that can receive frames of audio by subscribing to WebVoiceProcessor.


WebVoiceProcessor

class WebVoiceProcessor { }

Class for capturing audio and delivering audio data to subscribing audio processing engines.


WebVoiceProcessor.audioContext

static get audioContext(): AudioContext | null

Gets the current audio context.


WebVoiceProcessor.isRecording

static get isRecording(): boolean

Flag to check if WebVoiceProcessor is currently recording.


WebVoiceProcessor.audioDump()

public static async audioDump(durationMs: number = 3000): Promise<Blob>

Record some sample raw signed 16-bit PCM data for some duration, then pack it as a Blob.

Parameters

  • durationMs number : Duration of the recording, in milliseconds.

Returns

  • Promise<Blob> : The audio data in Blob format, wrapped in a Promise.

WebVoiceProcessor.subscribe()

public static async subscribe(engines: PvEngine | PvEngine[]): Promise<void>

Subscribe one or more engines. A subscribed engine will receive audio frames via .postMessage({command: 'process', inputFrame: inputFrame}). Audio capture will start as soon as there is one or more engine subscribed.

Parameters

  • engines PvEngine | PvEngine[] : The engine(s) to subscribe.

WebVoiceProcessor.unsubscribe()

public static async unsubscribe(engines: PvEngine | PvEngine[]): Promise<void>

Unsubscribe one or more engines. The unsubscribed engines will no longer receive audio frames. Audio capture will stop as soon as there is no more engines subscribed.

Parameters

  • engines PvEngine | PvEngine[] : The engine(s) to unsubscribe.

WebVoiceProcessor.reset()

static async reset(): Promise<void>

Removes all engines and stops recording audio.


WebVoiceProcessor.setOptions()

static setOptions(options: WebVoiceProcessorOptions, forceUpdate = false): void

Set new WebVoiceProcessor options. If forceUpdate is not set to true, all engines must be unsubscribed and subscribed again in order for the recorder to take the new changes. Using forceUpdate might cause a small gap where audio frames are not received.

Parameters

  • options WebVoiceProcessorOptions : Audio configuration for recording.
  • forceUpdate boolean : Flag to force update recorder with new options.

WebVoiceProcessorOptions

type WebVoiceProcessorOptions = {
frameLength?: number;
outputSampleRate?: number;
deviceId?: string | null;
filterOrder?: number
};

Type containing the audio recording configuration use by WebVoiceProcessor.

Parameters

  • frameLength number : Number of samples per frame of audio (default: 512).
  • outputSampleRate number : Target sample rate of recorded audio (default: 16000).
  • deviceId string | null : Microphone id to use (can be fetched with mediaDevices.enumerateDevices).
  • filterOrder number : Filter order (default: 50).

WvpError

class WvpError extends Error { }

Class the represents errors produced by WebVoiceProcessor.


WvpMessageEvent

type WvpMessageEvent = {
command: 'process',
inputFrame: Int16Array
};

Class that represents the message an engine receives when a frame of audio is captured by WebVoiceProcessor.

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Voice Processor Web API
  • PvEngine
  • WebVoiceProcessor
  • audioContext
  • isRecording
  • audioDump()
  • subscribe()
  • unsubscribe()
  • reset()
  • setOptions()
  • WebVoiceProcessorOptions
  • WvpError
  • WvpMessageEvent
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.