close
close

Remove noise in 3 lines of Python

Remove noise in 3 lines of Python

August 22, 2024 1 min read

Learn how to remove background acoustic noise using the Picovoice Koala Noise Removal Python SDK.

Koala Noise Suppression performs speech enhancement locally, preserving the privacy of your speech data (i.e., it is GDPR and HIPAA compliant by design). Additionally, by running on-device, Koala Noise Suppression ensures real-time processing with minimal latency. The SDK works on Linux, macOS, Windows, Raspberry Pi, and NVIDIA Jetson. Koala Noise Suppression can also run on Android, iOS, and web browsers.

Noise cancellation, noise suppression and speech enhancement are the same thing.

Install the Noise Suppression Python SDK
Install the SDK:

pip install pvkoala
Enter full screen mode

Exit full screen mode

Sign up for Picovoice Console
Log in (register) to Picovoice Console. It’s free and no credit card required! Copy your access key to the clipboard.

Line 1
Import the package:

import pvkoala
Enter full screen mode

Exit full screen mode

Line 2
Create an instance of the noise suppression object with your AccessKey:

handle = pvkoala.create(access_key)
Enter full screen mode

Exit full screen mode

Line 3
Remove noise:

enhanced_pcm = handle.process(pcm)
Enter full screen mode

Exit full screen mode

Koala Noise Suppression processes incoming audio in frames. The length of each frame can be obtained via handle.frame_length. Koala Noise Suppression operates on a single channel and on 16 kHz audio.

It only takes 90 seconds to remove noise and improve speech!

Source code
The source code for a fully functional demo with Koala Noise Suppression Python SDK is available on GitHub.

For more information, see the Koala Noise Suppression product page or refer to the Koala Noise Suppression Python SDK Quick Start Guide.