DEV Community

grace
grace

Posted on

Suppress Noise in 3 Lines of Python

August 22, 2024 · 1 min read

Learn how to suppress background acoustic noise using Picovoice Koala Noise Suppression Python SDK.

Koala Noise Suppression performs speech enhancement locally, keeping your voice data private (i.e. GDPR and HIPAA-compliant by design). Furthermore, by running on the device, Koala Noise Suppression guarantees real-time processing with minimum latency. The SDK runs on Linux, macOS, Windows, Raspberry Pi, and NVIDIA Jetson. Koala Noise Suppression can also run on Android, iOS, and web browsers.

Noise Suppression, Noise Cancellation, and Speech Enhancement are the same.

Install Noise Suppression Python SDK
Install the SDK:

pip install pvkoala
Enter fullscreen mode Exit fullscreen mode

Sign up for Picovoice Console
Log in to (sign up for) Picovoice Console. It is free, and no credit card is required! Copy your AccessKey to the clipboard.

Line 1
Import the package:

import pvkoala
Enter fullscreen mode Exit fullscreen mode

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

handle = pvkoala.create(access_key)
Enter fullscreen mode Exit fullscreen mode

Line 3
Suppress noise:

enhanced_pcm = handle.process(pcm)
Enter fullscreen mode Exit fullscreen mode

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

It only takes 90 seconds to suppress noise and enhance speech!

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

For more information, check out the Koala Noise Suppression product page or refer to the Koala Noise Suppression Python SDK quick start guide.

Top comments (0)