Picovoice Wordmark
Start Building
Introduction
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryPicovoice picoLLMGPTQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-TextWhisper Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeWeb
SummaryPicovoice CheetahAzure Real-Time Speech-to-TextAmazon Transcribe StreamingGoogle Streaming ASR
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 NativeSafariWebWindows
AndroidC.NETFlutteriOSJavaMicrocontrollerNode.jsPythonReactReact NativeWeb
SummaryPicovoice PorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeSafariWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryPicovoice CobraWebRTC VADSilero VAD
FAQ
Introduction
AndroidC.NETFlutteriOSNode.jsPythonReact NativeWeb
AndroidC.NETFlutteriOSNode.jsPythonReact NativeWeb
Introduction
C.NETNode.jsPython
C.NETNode.jsPython
FAQGlossary

Koala Noise Suppression
Python API

API Reference for the Python Koala SDK (PyPI).


pvkoala.create()

def create(
access_key: str,
model_path: Optional[str] = None,
device: Optional[str] = None,
library_path: Optional[str] = None) -> Koala

Factory method for Koala Noise Suppression engine.

Parameters

  • access_key str : AccessKey obtained from Picovoice Console.
  • model_path Optional[str] : Absolute path to the file containing model parameters.
  • device Optional[str] : String representation of the device (e.g., CPU or GPU) to use. If set to best, the most suitable device is selected automatically. If set to gpu, the engine uses the first available GPU device. To select a specific GPU device, set this argument to gpu:${GPU_INDEX}, where ${GPU_INDEX} is the index of the target GPU. If set tocpu, the engine will run on the CPU with the default number of threads. To specify the number of threads, set this argument to cpu:${NUM_THREADS}, where ${NUM_THREADS} is the desired number of threads.
  • library_path Optional[str] : Absolute path to Koala's dynamic library.

Returns

  • Koala: An instance of Koala Noise Suppression engine.

Throws

  • KoalaError

pvkoala.available_devices()

def available_devices(library_path: Optional[str] = None) -> Sequence[str]

Lists all available devices that Koala can use for inference. Each entry in the list can be the device argument of create() factory method or Koala constructor.

Parameters

  • library_path Optional[str] : Absolute path to Koala's dynamic library. If not set it will be set to the default location.

Returns

  • Sequence[str]: List of all available devices that Koala can use for inference.

Throws

  • KoalaError

pvkoala.Koala

class Koala(object)

Class for the Koala Noise Suppression engine. Koala can be initialized either using the module level create() function or directly using the class __init__() method. Resources should be cleaned when you are done using the delete() method.


pvkoala.Koala.version

self.version: str

The version string of the Koala library.


pvkoala.Koala.frame_length

self.frame_length: int

The number of audio samples per frame that Koala accepts.


pvkoala.Koala.sample_rate

self.sample_rate: int

The audio sample rate the Koala accepts.


pvkoala.Koala.delay_sample

self.delay_sample: int

Delay in samples. If the input and output of consecutive calls to process() are viewed as two contiguous streams of audio data, this delay specifies the time shift between the input and output stream.


pvkoala.Koala.__init__()

def __init__(
self,
access_key: str,
model_path: str,
device: str,
library_path: str) -> Koala

__init__ method for Koala Noise Suppression engine.

Parameters

  • access_key str : AccessKey obtained from Picovoice Console.
  • model_path str : Absolute path to the file containing model parameters.
  • device str : String representation of the device (e.g., CPU or GPU) to use. If set to best, the most suitable device is selected automatically. If set to gpu, the engine uses the first available GPU device. To select a specific GPU device, set this argument to gpu:${GPU_INDEX}, where ${GPU_INDEX} is the index of the target GPU. If set tocpu, the engine will run on the CPU with the default number of threads. To specify the number of threads, set this argument to cpu:${NUM_THREADS}, where ${NUM_THREADS} is the desired number of threads.
  • library_path str : Absolute path to Koala's dynamic library.

Returns

  • Koala: An instance of Koala Noise Suppression engine.

Throws

  • KoalaError

pvkoala.Koala.delete()

def delete(self)

Releases resources acquired by Koala.


pvkoala.Koala.process()

def process(self, pcm: Sequence[int]) -> Sequence[int]

Processes a frame of audio and returns delayed enhanced audio.

The number of samples per frame can be attained from frame_length. The incoming audio needs to have a sample rate equal to sample_rate and be 16-bit linearly-encoded. Koala operates on single-channel audio. Consecutive calls to process() must provide consecutive frames of audio from the same source, unless reset() has been called in between.

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 delay_sample.

Parameters

  • pcm Sequence[int] : A frame of audio samples.

Returns

  • Sequence[int] : A frame of enhanced audio samples, stored as a sequence of 16-bit linearly-encoded integers.

Throws

  • KoalaError

pvkoala.Koala.reset()

def reset(self) -> None

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.

Throws

  • KoalaError

pvkoala.list_hardware_devices()

def list_hardware_devices(library_path: str) -> Sequence[str]:

Lists all available devices that Koala can use for inference. Each entry in the list can be the device argument of create() factory method or Koala constructor.

Internal method. The higher level pvkoala.available_devices() should be used instead.

Parameters

  • library_path str : Absolute path to Koala's dynamic library.

Returns

  • Sequence[str]: List of all available devices that Koala can use for inference.

Throws

  • KoalaError

pvkoala.KoalaError

class KoalaError(Exception)

Error thrown if an error occurs within Koala Noise Suppression engine.

Exceptions

class KoalaActivationError(KoalaError)
class KoalaActivationLimitError(KoalaError)
class KoalaActivationRefusedError(KoalaError)
class KoalaActivationThrottledError(KoalaError)
class KoalaIOError(KoalaError)
class KoalaInvalidArgumentError(KoalaError)
class KoalaInvalidStateError(KoalaError)
class KoalaKeyError(KoalaError)
class KoalaMemoryError(KoalaError)
class KoalaRuntimeError(KoalaError)
class KoalaStopIterationError(KoalaError)

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Koala Noise Suppression Python API
  • pvkoala.create()
  • pvkoala.available_devices()
  • pvkoala.Koala
  • version
  • frame_length
  • sample_rate
  • delay_sample
  • __init__()
  • delete()
  • process()
  • reset()
  • pvkoala.list_hardware_devices()
  • pvkoala.KoalaError
Voice AI
  • picoLLM On-Device LLM
  • 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
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.