io.agora.rtc

## Class AgoraAudioVadConfigV2

- java.lang.Object
- - io.agora.rtc.AgoraAudioVadConfigV2

-     public class AgoraAudioVadConfigV2
      extends java.lang.Object

  Configuration class for Agora Audio Voice Activity Detection (VAD) V2.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private float` | `activePercent` The percentage of active frames required in startRecognizeCount frames to enter speaking state.
    `private float` | `inactivePercent` The percentage of inactive frames required in stopRecognizeCount frames to enter stop speaking state.
    `private int` | `preStartRecognizeCount` The number of audio frames to save before entering the start speaking state.
    `private int` | `startRecognizeCount` The number of audio frames required to confirm the speaking state.
    `private int` | `startRmsThreshold` rms: for rmsThreshold, the higher the value, the more sensitive to voice activity.
    `private int` | `startVoiceProb` voice prob: The lower the gate threshold, the higher the probability that a frame is judged as activity, which allows the start phase to begin earlier.
    `private int` | `stopRecognizeCount` The number of audio frames required to confirm the stop speaking state.
    `private int` | `stopRmsThreshold` rms: for rmsThreshold, the higher the value, the more sensitive to voice activity.
    `private int` | `stopVoiceProb` voice prob: The lower the gate threshold, the higher the probability that a frame is judged as activity, which allows the start phase to begin earlier.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AgoraAudioVadConfigV2()`
    `AgoraAudioVadConfigV2(int preStartRecognizeCount, int startRecognizeCount, int stopRecognizeCount, float activePercent, float inactivePercent, int startVoiceProb, int stopVoiceProb, int startRmsThreshold, int stopRmsThreshold)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `float` | `getActivePercent()`
    `float` | `getInactivePercent()`
    `int` | `getPreStartRecognizeCount()`
    `int` | `getStartRecognizeCount()`
    `int` | `getStartRmsThreshold()`
    `int` | `getStartVoiceProb()`
    `int` | `getStopRecognizeCount()`
    `int` | `getStopRmsThreshold()`
    `int` | `getStopVoiceProb()`
    `void` | `setActivePercent(float activePercent)`
    `void` | `setInactivePercent(float inactivePercent)`
    `void` | `setPreStartRecognizeCount(int preStartRecognizeCount)`
    `void` | `setStartRecognizeCount(int startRecognizeCount)`
    `void` | `setStartRmsThreshold(int startRmsThreshold)`
    `void` | `setStartVoiceProb(int startVoiceProb)`
    `void` | `setStopRecognizeCount(int stopRecognizeCount)`
    `void` | `setStopRmsThreshold(int stopRmsThreshold)`
    `void` | `setStopVoiceProb(int stopVoiceProb)`
    `java.lang.String` | `toString()`

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

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

- - ### Field Detail

    - #### preStartRecognizeCount

          private int preStartRecognizeCount

      The number of audio frames to save before entering the start speaking state. Default: 16 frames Range: [0, Integer.MAX_VALUE]

    - #### startRecognizeCount

          private int startRecognizeCount

      The number of audio frames required to confirm the speaking state. Default: 30 frames Range: [1, Integer.MAX_VALUE]

    - #### stopRecognizeCount

          private int stopRecognizeCount

      The number of audio frames required to confirm the stop speaking state. Default: 20 frames Range: [1, Integer.MAX_VALUE]

    - #### activePercent

          private float activePercent

      The percentage of active frames required in startRecognizeCount frames to enter speaking state. Default: 0.7 (70%) Range: [0.0, 1.0]

    - #### inactivePercent

          private float inactivePercent

      The percentage of inactive frames required in stopRecognizeCount frames to enter stop speaking state. Default: 0.5 (50%) Range: [0.0, 1.0]

    - #### startVoiceProb

          private int startVoiceProb

      voice prob: The lower the gate threshold, the higher the probability that a frame is judged as activity, which allows the start phase to begin earlier. Conversely, the higher the gate threshold, the lower the probability that a frame is judged as activity, and the higher the probability of being judged as inactivity, which allows the end phase to begin earlier. default: 70 range: [0, 100]

    - #### stopVoiceProb

          private int stopVoiceProb

      voice prob: The lower the gate threshold, the higher the probability that a frame is judged as activity, which allows the start phase to begin earlier. Conversely, the higher the gate threshold, the lower the probability that a frame is judged as activity, and the higher the probability of being judged as inactivity, which allows the end phase to begin earlier. default: 70 range: [0, 100]

    - #### startRmsThreshold

          private int startRmsThreshold

      rms: for rmsThreshold, the higher the value, the more sensitive to voice activity. In a quiet environment, it can be set to -50; In a noisy environment, it can be set to a value between -40 and -30. default: -50 range: [-100, 0]

    - #### stopRmsThreshold

          private int stopRmsThreshold

      rms: for rmsThreshold, the higher the value, the more sensitive to voice activity. In a quiet environment, it can be set to -50; In a noisy environment, it can be set to a value between -40 and -30. default: -50 range: [-100, 0]

  - ### Constructor Detail

    - #### AgoraAudioVadConfigV2

          public AgoraAudioVadConfigV2()

    - #### AgoraAudioVadConfigV2

          public AgoraAudioVadConfigV2(int preStartRecognizeCount,
                                       int startRecognizeCount,
                                       int stopRecognizeCount,
                                       float activePercent,
                                       float inactivePercent,
                                       int startVoiceProb,
                                       int stopVoiceProb,
                                       int startRmsThreshold,
                                       int stopRmsThreshold)

  - ### Method Detail

    - #### getPreStartRecognizeCount

          public int getPreStartRecognizeCount()

    - #### setPreStartRecognizeCount

          public void setPreStartRecognizeCount(int preStartRecognizeCount)

    - #### getStartRecognizeCount

          public int getStartRecognizeCount()

    - #### setStartRecognizeCount

          public void setStartRecognizeCount(int startRecognizeCount)

    - #### getStopRecognizeCount

          public int getStopRecognizeCount()

    - #### setStopRecognizeCount

          public void setStopRecognizeCount(int stopRecognizeCount)

    - #### getActivePercent

          public float getActivePercent()

    - #### setActivePercent

          public void setActivePercent(float activePercent)

    - #### getInactivePercent

          public float getInactivePercent()

    - #### setInactivePercent

          public void setInactivePercent(float inactivePercent)

    - #### getStartVoiceProb

          public int getStartVoiceProb()

    - #### setStartVoiceProb

          public void setStartVoiceProb(int startVoiceProb)

    - #### getStopVoiceProb

          public int getStopVoiceProb()

    - #### setStopVoiceProb

          public void setStopVoiceProb(int stopVoiceProb)

    - #### getStartRmsThreshold

          public int getStartRmsThreshold()

    - #### setStartRmsThreshold

          public void setStartRmsThreshold(int startRmsThreshold)

    - #### getStopRmsThreshold

          public int getStopRmsThreshold()

    - #### setStopRmsThreshold

          public void setStopRmsThreshold(int stopRmsThreshold)

    - #### toString

          public java.lang.String toString()

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