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

Koala Noise Suppression
Web API


API Reference for the Koala Web SDK (npm ).


Koala

class Koala {}

Class for the Koala Noise Suppression engine.


Koala.create()

static async function create(
accessKey: string,
processCallback: (enhancedPcm: Int16Array) => void,
model: KoalaModel,
options: KoalaOptions = {}
): Promise<Koala>

Creates an instance of the Koala Noise Suppression engine.

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console .
  • processCallback (enhancedPcm: Int16Array) => void : User-defined callback invoked when a frame of audio is processed.
  • model KoalaModel : Koala model options.
  • options KoalaOptions : Optional configuration arguments.

Returns

  • Koala : An instance of the Koala engine.

Koala.process()

async function process(pcm: Int16Array): Promise<void>

Processes a frame of audio. The required sample rate can be retrieved from sampleRate and the length of frame (number of audio samples per frame) can be retrieved from frameLength. The audio must be single-channel and 16-bit linearly-encoded.

The output is not directly the enhanced version of the input PCM, but corresponds to samples that were given in previous calls to process(). The delay in samples between the start time of the input frame and the start time of the output frame can be attained from delaySample.

Parameters

  • pcm Int16Array : A frame of audio samples.

Koala.reset()

async function reset(): Promise<void>

Marks the end of the audio stream and resets the internal state of the object. Call this function in between calls to process that do not provide consecutive frames of audio.


Koala.release()

async function release(): Promise<void>

Releases resources acquired by the Koala Web SDK.


Koala.frameLength

get framelength(): number

Number of audio samples per frame.


Koala.sampleRate

get sampleRate(): number

Audio sample rate accepted by Koala.


Koala.version

get version(): string

Koala version string.


Koala.delaySample

get delaySample(): number

Koala delay in samples.


KoalaModel

type KoalaModel = {
base64?: string;
publicPath?: string;
customWritePath?: string;
forceWrite?: boolean;
version?: number;
}

Koala model type.

  • base64 string: The model file (.pv) in base64 string to initialize Koala.
  • publicPath string: The model file (.pv) path relative to the public directory.
  • customWritePath string : Custom path to save the model in storage. Set to a different name to use multiple models across koala instances.
  • forceWrite boolean : Flag to overwrite the model in storage even if it exists.
  • version number : Version of the model file. Increment to update the model file in storage.

KoalaOptions

type KoalaOptions = {
processErrorCallback?: (error: string) => void
}

Koala options type.

  • processErrorCallback boolean : User-defined callback invoked if any error happens while processing the audio stream. Its only input argument is the error message.

KoalaWorker

class KoalaWorker {}

A class for running the Koala Noise Suppression engine as a web worker thread.


KoalaWorker.create()

static async function create(
accessKey: string,
processCallback: (enhancedPcm: Int16Array) => void,
model: KoalaModel,
options: KoalaOptions = {}
): Promise<KoalaWorker>

Creates an instance of KoalaWorker.

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console .
  • processCallback (enhancedPcm: Int16Array) => void : User-defined callback invoked when a frame of audio is processed.
  • model KoalaModel : Koala model options.
  • options KoalaOptions : Optional configuration arguments.

Returns

  • KoalaWorker : An instance of KoalaWorker.

KoalaWorker.process()

async function process(pcm: Int16Array): void

Processes a frame of audio. The required sample rate can be retrieved from 'sampleRate' and the length of frame (number of audio samples per frame) can be retrieved from 'frameLength'. The audio must be single-channel and 16-bit linearly-encoded.

The output is not directly the enhanced version of the input PCM, but corresponds to samples that were given in previous calls to process(). The delay in samples between the start time of the input frame and the start time of the output frame can be attained from delaySample.

Parameters

  • pcm Int16Array : A frame of audio samples.

KoalaWorker.reset()

async function reset(): Promise<void>

Marks the end of the audio stream and resets the internal state of the object. Call this function in between calls to process that do not provide consecutive frames of audio.


KoalaWorker.release()

async function release(): Promise<void>

Releases resources acquired by the Koala Web SDK.


KoalaWorker.terminate()

async function terminate(): Promise<void>

Force terminates the instance of KoalaWorker.


KoalaWorker.frameLength

get frameLength(): number

Number of audio samples per frame.


KoalaWorker.sampleRate

get sampleRate(): number

Audio sample rate accepted by Koala.


KoalaWorker.version

get version(): string

Koala version string.


Koala.delaySample

get delaySample(): number

Koala delay in samples.

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Koala Noise Suppression Web API
  • Koala
  • create()
  • process()
  • reset()
  • release()
  • frameLength
  • sampleRate
  • version
  • delaySample
  • KoalaModel
  • KoalaOptions
  • KoalaWorker
  • create()
  • process()
  • reset()
  • release()
  • terminate()
  • frameLength
  • sampleRate
  • version
  • delaySample
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.