setAINSMode abstract method

Future<void> setAINSMode({
  1. required bool enabled,
  2. required AudioAinsMode mode,
})

Enables or disables AI noise reduction and sets the noise reduction mode.

You can call this method to enable the AI noise reduction feature. This feature intelligently detects and reduces various stationary and non-stationary background noises while maintaining voice quality, making human voices clearer. Stationary noise refers to noise with consistent frequency over time, such as: TV noise Air conditioner noise Factory machine noise Non-stationary noise refers to noise that changes rapidly over time, such as: Thunder Explosions Cracking sounds This method depends on the AI noise reduction dynamic library. Deleting this library will prevent the feature from working properly. For the name of the AI noise reduction library, see Plugin List. Currently, it is not recommended to enable this feature on devices running Android 6.0 or lower.

  • enabled Whether to enable AI noise reduction: true : Enable AI noise reduction. false : (default) Disable AI noise reduction.
  • mode Noise reduction mode. See AudioAinsMode.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. See Error Codes for details and resolution suggestions.

Implementation

Future<void> setAINSMode(
    {required bool enabled, required AudioAinsMode mode});