io.agora.rtc

## Class AgoraAudioVad

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

-     public class AgoraAudioVad
      extends java.lang.Object

  Voice Activity Detection (VAD) implementation for Agora SDK. This class provides functionality to detect voice activity in audio streams.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private long` | `cptr` Native pointer for the VAD instance.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AgoraAudioVad()` Constructs a VAD instance and loads native resources.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroy()` Destroy the VAD module
    `int` | `initialize(AgoraAudioVadConfig config)` Initialize the VAD module
    `private void` | `nativeDestroy(long cptr)` Releases native VAD resources.
    `private long` | `nativeInitialize(AgoraAudioVadConfig config)` Initializes the native VAD instance.
    `private VadProcessResult` | `nativeProcessPcmFrame(byte[] frame)` Processes a PCM frame through the native VAD.
    `VadProcessResult` | `processPcmFrame(byte[] frame)` Process the PCM frame

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

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

- - ### Field Detail

    - #### cptr

          private long cptr

      Native pointer for the VAD instance.

  - ### Constructor Detail

    - #### AgoraAudioVad

          public AgoraAudioVad()

      Constructs a VAD instance and loads native resources.

  - ### Method Detail

    - #### initialize

          public int initialize(AgoraAudioVadConfig config)

      Initialize the VAD module
      Parameters:
        `config` - the configuration of the VAD module
      Returns:
        0 if success, -1 if failed

    - #### processPcmFrame

          public VadProcessResult processPcmFrame(byte[] frame)

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

    - #### destroy

          public void destroy()

      Destroy the VAD module

    - #### nativeDestroy

          private void nativeDestroy(long cptr)

      Releases native VAD resources.
      Parameters:
        `cptr` - Native pointer

    - #### nativeInitialize

          private long nativeInitialize(AgoraAudioVadConfig config)

      Initializes the native VAD instance.
      Parameters:
        `config` - VAD configuration
      Returns:
        Native pointer to the VAD instance

    - #### nativeProcessPcmFrame

          private VadProcessResult nativeProcessPcmFrame(byte[] frame)

      Processes a PCM frame through the native VAD.
      Parameters:
        `frame` - PCM data
      Returns:
        Processing result