Noise Suppression technology mutes unwanted background noise, providing clear audio for communication. Applying noise suppression to recorded audio is not a trivial task in Android.

Android provides built-in features and solutions to noise suppression which only works with Android's AudioRecord API. Processing other methods and sources of audio is a problem left for a user to solve.

Picovoice's Koala Noise Suppression provides a fast and easy method for processing and suppressing audio on device.

Koala Noise Suppression engine is available for Android versions 5.0 (SDK 21) and later.

Koala Noise Suppression Android SDK

To integrate the Koala Noise Suppression SDK into your Android project, ensure you have included mavenCentral() in your top-level build.gradle file, then add the following dependency to your app’s build.gradle file:

This example uses AndroidVoiceProcessor to record audio.

Sign up for Picovoice Console

Sign up for Picovoice Console for free and copy your AccessKey. It handles authentication and authorization.

Usage

Permissions

To enable AccessKey validation and recording with your Android device's microphone, add the following to the app's AndroidManifest.xml file:

Initialization

Create an instance of the engine with the Koala Builder class by passing in the AccessKey from the previous step and the Android app context, and get the singleton instance of VoiceProcessor:

Processing Audio Frames

Koala Noise Suppression processes audio in chunks, also known as audio frames. The .frameLength property gives the number of audio samples per frame that are required by Koala, while the .sampleRate property gives the audio sample rate that is required. Audio samples must be 16-bit integers.

Use VoiceProcessor.addFrameListener to add a listener to VoiceProcessor that receives audio frames and passes them along to Koala for processing:

In the case that the next audio frame does not follow the previous one, call reset before processing audio.

Start processing audio using VoiceProcessor.start by passing Koala's frame length and sample rate as arguments:

This will start VoiceProcessor and the audio frames are passed to the listeners as mentioned above.

To stop processing audio, call VoiceProcessor.stop:

Clean up

Call VoiceProcessor.clearFrameListeners and Koala.delete to clear any allocated resources:

Working Example

For a complete working project, take a look at the Koala Noise Suppression Android Demo.

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

Start Building