io.agora.rtc.audio3a

## Class AgcConfig

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

-     public class AgcConfig
      extends java.lang.Object

  Configuration for Automatic Gain Control (AGC).

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private int` | `curveSlope` Digital AGC slope.
    `private boolean` | `enabled` Whether to enable AGC.
    `private int` | `maxDigitalGaindB` Maximum digital AGC gain in dB.
    `private int` | `targetleveldB` Target digital AGC level in dB.
    `private boolean` | `useAnalogMode` Whether to use analog AGC working mode.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AgcConfig()` Creates an AGC configuration with default values.
    `AgcConfig(boolean enabled, boolean useAnalogMode, int maxDigitalGaindB, int targetleveldB, int curveSlope)` Constructs an AgcConfig object.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getCurveSlope()` Gets the digital AGC slope.
    `int` | `getMaxDigitalGaindB()` Gets the maximum digital AGC gain in dB.
    `int` | `getTargetleveldB()` Gets the target digital AGC level in dB.
    `boolean` | `isEnabled()` Checks if AGC is enabled.
    `boolean` | `isUseAnalogMode()` Checks if analog AGC mode is used.
    `void` | `setCurveSlope(int curveSlope)` Sets the digital AGC slope.
    `void` | `setEnabled(boolean enabled)` Sets whether to enable AGC.
    `void` | `setMaxDigitalGaindB(int maxDigitalGaindB)` Sets the maximum digital AGC gain in dB.
    `void` | `setTargetleveldB(int targetleveldB)` Sets the target digital AGC level in dB.
    `void` | `setUseAnalogMode(boolean useAnalogMode)` Sets whether to use analog AGC 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 AGC. - true: Enable AGC. - false: (Default) Disable AGC.

    - #### useAnalogMode

          private boolean useAnalogMode

      Whether to use analog AGC working mode. - true: Use analog mode. Analog AGC is only available for platforms with an analog volume control on the capture device. The SetStreamAnalogLevel and StreamAnalogLevel methods provide coupling between OS analog volume control and AGC. - false: (Default) Use digital mode.

    - #### maxDigitalGaindB

          private int maxDigitalGaindB

      Maximum digital AGC gain in dB. Recommended values should be within [6,30], and default value is 12.

    - #### targetleveldB

          private int targetleveldB

      Target digital AGC level in dB. Recommended values should be within [-18,0], // Corrected range based on likely intent and default value is -6. // Corrected default based on likely intent

    - #### curveSlope

          private int curveSlope

      Digital AGC slope. Recommended values should be within [3,30], and default value is 17.

  - ### Constructor Detail

    - #### AgcConfig

          public AgcConfig()

      Creates an AGC configuration with default values.

    - #### AgcConfig

          public AgcConfig(boolean enabled,
                           boolean useAnalogMode,
                           int maxDigitalGaindB,
                           int targetleveldB,
                           int curveSlope)

      Constructs an AgcConfig object.
      Parameters:
        `enabled` - Whether to enable AGC. `true` to enable, `false` to disable (default).
        `useAnalogMode` - Whether to use analog AGC mode. `true` for analog, `false` for digital (default).
        `maxDigitalGaindB` - Maximum digital AGC gain in dB. Recommended: [6, 30]. Default: 12.
        `targetleveldB` - Target digital AGC level in dB. Recommended: [-18, 0]. Default: -6.
        `curveSlope` - Digital AGC slope. Recommended: [3, 30]. Default: 17.

  - ### Method Detail

    - #### isEnabled

          public boolean isEnabled()

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

    - #### setEnabled

          public void setEnabled(boolean enabled)

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

    - #### isUseAnalogMode

          public boolean isUseAnalogMode()

      Checks if analog AGC mode is used.
      Returns:
        `true` if analog mode is used, `false` if digital mode is used.

    - #### setUseAnalogMode

          public void setUseAnalogMode(boolean useAnalogMode)

      Sets whether to use analog AGC mode.
      Parameters:
        `useAnalogMode` - `true` to use analog mode, `false` to use digital mode.

    - #### getMaxDigitalGaindB

          public int getMaxDigitalGaindB()

      Gets the maximum digital AGC gain in dB.
      Returns:
        The maximum digital gain in dB.

    - #### setMaxDigitalGaindB

          public void setMaxDigitalGaindB(int maxDigitalGaindB)

      Sets the maximum digital AGC gain in dB.
      Parameters:
        `maxDigitalGaindB` - The maximum digital gain in dB. Recommended: [6, 30].

    - #### getTargetleveldB

          public int getTargetleveldB()

      Gets the target digital AGC level in dB.
      Returns:
        The target level in dB.

    - #### setTargetleveldB

          public void setTargetleveldB(int targetleveldB)

      Sets the target digital AGC level in dB.
      Parameters:
        `targetleveldB` - The target level in dB. Recommended: [-18, 0].

    - #### getCurveSlope

          public int getCurveSlope()

      Gets the digital AGC slope.
      Returns:
        The curve slope.

    - #### setCurveSlope

          public void setCurveSlope(int curveSlope)

      Sets the digital AGC slope.
      Parameters:
        `curveSlope` - The curve slope. Recommended: [3, 30].

    - #### toString

          public java.lang.String toString()

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