io.agora.rtc

## Class AgoraAudioVadV2

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

-     public class AgoraAudioVadV2
      extends java.lang.Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `private class` | `AgoraAudioVadV2.VadData`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private Constants.VadState` | `currentState`
    `private java.util.Deque<AgoraAudioVadV2.VadData>` | `startQueue`
    `private int` | `startSize`
    `private java.util.Deque<AgoraAudioVadV2.VadData>` | `stopQueue`
    `private AgoraAudioVadConfigV2` | `vadConfig`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AgoraAudioVadV2(AgoraAudioVadConfigV2 config)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroy()`
    `private int` | `getSilenceCount(java.util.Deque<AgoraAudioVadV2.VadData> queue, int startIndex)`
    `private void` | `initData()`
    `private boolean` | `isVadActive(AudioFrame frame, AgoraAudioVadConfigV2 currentVadConfig)`
    `VadProcessResult` | `processFrame(AudioFrame frame)` Process the audio frame
    `private byte[]` | `processSpeaking(AgoraAudioVadV2.VadData vadData, AgoraAudioVadConfigV2 currentVadConfig)`
    `private byte[]` | `processStart(AgoraAudioVadV2.VadData vadData, AgoraAudioVadConfigV2 currentVadConfig)`

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

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

- - ### Field Detail

    - #### vadConfig

          private volatile AgoraAudioVadConfigV2 vadConfig

    - #### currentState

          private volatile Constants.VadState currentState

    - #### startSize

          private volatile int startSize

    - #### startQueue

          private volatile java.util.Deque<AgoraAudioVadV2.VadData> startQueue

    - #### stopQueue

          private volatile java.util.Deque<AgoraAudioVadV2.VadData> stopQueue

  - ### Constructor Detail

    - #### AgoraAudioVadV2

          public AgoraAudioVadV2(AgoraAudioVadConfigV2 config)

  - ### Method Detail

    - #### initData

          private void initData()

    - #### processFrame

          public VadProcessResult processFrame(AudioFrame frame)

      Process the audio frame
      Parameters:
        `frame` - the audio frame
      Returns:
        the result of the VAD process

    - #### isVadActive

          private boolean isVadActive(AudioFrame frame,
                                      AgoraAudioVadConfigV2 currentVadConfig)

    - #### processStart

          private byte[] processStart(AgoraAudioVadV2.VadData vadData,
                                      AgoraAudioVadConfigV2 currentVadConfig)

    - #### processSpeaking

          private byte[] processSpeaking(AgoraAudioVadV2.VadData vadData,
                                         AgoraAudioVadConfigV2 currentVadConfig)

    - #### getSilenceCount

          private int getSilenceCount(java.util.Deque<AgoraAudioVadV2.VadData> queue,
                                      int startIndex)

    - #### destroy

          public void destroy()