logo
In-app Chat
SDK Error Codes
Powered Byspreading
On this page

ANS

Ambient noise suppression (ANS) recognizes and clears background noise to enhance the quality of recorded audio and user experience. This feature is better at suppressing continuous noise, such as rain sounds and other white noise .

Warning

To use this feature, contact ZEGOCLOUD technical support to enable it. Pro or Enterprise users can enable it free of charge.

Prerequisites

Before you implement the ANS feature, make sure that the following conditions are met:

Enable the feature

After the initialization, call the enableANS method to enable the feature.

Untitled
// Enable the ANS feature.
ZIMAudio.getInstance().enableANS(true);
1
Copied!

After the feature is enabled, you can start recording audio files. For more information, see Send and receive audio messages.

Note

If the ANS feature is enabled after recording starts, this feature does not take effect for this recording and takes effect for subsequent recordings only.

(Optional) Set ANS parameters

To change the ANS mode after enabling the ANS feature by calling the enableANS method, call the setANSParam method.

Untitled
ZIMAudioANSParam param = new ZIMAudioANSParam();
// Change the ANS mode to AGGRESSIVE.
param.mode = ZIMAudioANSMode.AGGRESSIVE;
ZIMAudio.getInstance().setANSParam(param);
1
Copied!

Previous

AGC

Next

ZIM