io.agora.rtc.audio3a

## Class AnsConfig

- java.lang.Object
- - io.agora.rtc.audio3a.AnsConfig

-     public class AnsConfig
      extends java.lang.Object

  Configuration for Automatic Noise Suppression (ANS).

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private Constants.AnsModelType` | `ansModelType` The ANS Model Type.
    `private boolean` | `enabled` Whether to enable ANS.
    `private int` | `speechProtectThreshold` The ANS speech protect threshold, which is used when possibly speech damage happened by ANS.
    `private Constants.AnsSuppressionMode` | `suppressionMode` The ANS noise suppression mode.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AnsConfig()` Default constructor for AnsConfig.
    `AnsConfig(boolean enabled, Constants.AnsSuppressionMode suppressionMode, Constants.AnsModelType ansModelType, int speechProtectThreshold)` Constructs an AnsConfig object.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Constants.AnsModelType` | `getAnsModelType()` Gets the ANS model type.
    `int` | `getSpeechProtectThreshold()` Gets the ANS speech protect threshold.
    `Constants.AnsSuppressionMode` | `getSuppressionMode()` Gets the ANS noise suppression mode.
    `boolean` | `isEnabled()` Checks if ANS is enabled.
    `void` | `setAnsModelType(Constants.AnsModelType ansModelType)` Sets the ANS model type.
    `void` | `setEnabled(boolean enabled)` Sets whether to enable ANS.
    `void` | `setSpeechProtectThreshold(int speechProtectThreshold)` Sets the ANS speech protect threshold.
    `void` | `setSuppressionMode(Constants.AnsSuppressionMode suppressionMode)` Sets the ANS noise suppression mode.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### enabled

          private boolean enabled

      Whether to enable ANS. - true: Enable ANS. - false: (Default) Disable ANS.

    - #### suppressionMode

          private Constants.AnsSuppressionMode suppressionMode

      The ANS noise suppression mode. See `Constants.AnsSuppressionMode`.

    - #### ansModelType

          private Constants.AnsModelType ansModelType

      The ANS Model Type. See `Constants.AnsModelType`.

    - #### speechProtectThreshold

          private int speechProtectThreshold

      The ANS speech protect threshold, which is used when possibly speech damage happened by ANS. The value range is [0, 100], the default value is 100, and we recommend 50 when you intended to protect speech.

  - ### Constructor Detail

    - #### AnsConfig

          public AnsConfig()

      Default constructor for AnsConfig. Initializes with default values: enabled=true, suppressionMode=AGGRESSIVE, ansModelType=STDAIANS, speechProtectThreshold=100.

    - #### AnsConfig

          public AnsConfig(boolean enabled,
                           Constants.AnsSuppressionMode suppressionMode,
                           Constants.AnsModelType ansModelType,
                           int speechProtectThreshold)

      Constructs an AnsConfig object.
      Parameters:
        `enabled` - Whether to enable ANS. `true` to enable, `false` to disable (default).
        `suppressionMode` - The ANS noise suppression mode. See `Constants.AnsSuppressionMode`.
        `ansModelType` - The ANS model type. See `Constants.AnsModelType`.
        `speechProtectThreshold` - The ANS speech protect threshold. Value range: [0, 100]. Default: 100. Recommended: 50 for speech protection.

  - ### Method Detail

    - #### isEnabled

          public boolean isEnabled()

      Checks if ANS is enabled.
      Returns:
        `true` if ANS is enabled, `false` otherwise.

    - #### setEnabled

          public void setEnabled(boolean enabled)

      Sets whether to enable ANS.
      Parameters:
        `enabled` - `true` to enable ANS, `false` to disable.

    - #### getSuppressionMode

          public Constants.AnsSuppressionMode getSuppressionMode()

      Gets the ANS noise suppression mode.
      Returns:
        The suppression mode. See `Constants.AnsSuppressionMode`.

    - #### setSuppressionMode

          public void setSuppressionMode(Constants.AnsSuppressionMode suppressionMode)

      Sets the ANS noise suppression mode.
      Parameters:
        `suppressionMode` - The suppression mode. See `Constants.AnsSuppressionMode`.

    - #### getAnsModelType

          public Constants.AnsModelType getAnsModelType()

      Gets the ANS model type.
      Returns:
        The ANS model type. See `Constants.AnsModelType`.

    - #### setAnsModelType

          public void setAnsModelType(Constants.AnsModelType ansModelType)

      Sets the ANS model type.
      Parameters:
        `ansModelType` - The ANS model type. See `Constants.AnsModelType`.

    - #### getSpeechProtectThreshold

          public int getSpeechProtectThreshold()

      Gets the ANS speech protect threshold.
      Returns:
        The speech protect threshold.

    - #### setSpeechProtectThreshold

          public void setSpeechProtectThreshold(int speechProtectThreshold)

      Sets the ANS speech protect threshold.
      Parameters:
        `speechProtectThreshold` - The speech protect threshold. Value range: [0, 100].

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`