io.agora.rtc.audio3a

## Class AgoraAudioProcessor

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

-     public class AgoraAudioProcessor
      extends java.lang.Object

  The AgoraAudioProcessor class. Agora uses this class to process audio frames.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private long` | `cptr` Native pointer

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AgoraAudioProcessor()` Constructs an AgoraAudioProcessor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `getSdkVersion()` Gets the SDK version.
    `int` | `init(java.lang.String appId, java.lang.String license, IAgoraAudioProcessorEventHandler eventHandler, AgoraAudioProcessorConfig config)` Initializes the audio processor with the specified parameters.
    `private long` | `nativeCreate()` Native create method.
    `private static java.lang.String` | `nativeGetSdkVersion()` Native method to get SDK version.
    `private int` | `nativeInit(long cptr, java.lang.String appId, java.lang.String license, IAgoraAudioProcessorEventHandler eventHandler, AgoraAudioProcessorConfig config)` Native init method.
    `private AgoraAudioFrame` | `nativeProcess(long cptr, AgoraAudioFrame nearIn, AgoraAudioFrame farIn)` Native process method.
    `private int` | `nativeRelease(long cptr)` Native release method.
    `AgoraAudioFrame` | `process(AgoraAudioFrame nearIn)` Processes the given audio frame and returns the processed frame.
    `AgoraAudioFrame` | `process(AgoraAudioFrame nearIn, AgoraAudioFrame farIn)` Processes the given audio frame and returns the processed frame.
    `int` | `release()` Releases the resources held by the audio processor.

    - ### 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

  - ### Constructor Detail

    - #### AgoraAudioProcessor

          public AgoraAudioProcessor()

      Constructs an AgoraAudioProcessor.

  - ### Method Detail

    - #### getSdkVersion

          public static java.lang.String getSdkVersion()

      Gets the SDK version.
      Returns:
        The SDK version.

    - #### init

          public int init(java.lang.String appId,
                          java.lang.String license,
                          IAgoraAudioProcessorEventHandler eventHandler,
                          AgoraAudioProcessorConfig config)

      Initializes the audio processor with the specified parameters.
      Parameters:
        `appId` - The App ID for authentication.
        `license` - The license key for the audio processor.
        `eventHandler` - The event handler for audio processor events.
        `config` - The configuration for the audio processor.
      Returns:
        0 if successful, or an error code otherwise.

    - #### process

          public AgoraAudioFrame process(AgoraAudioFrame nearIn)

      Processes the given audio frame and returns the processed frame.
      Parameters:
        `nearIn` - The input audio frame to process.
      Returns:
        The processed audio frame.

    - #### process

          public AgoraAudioFrame process(AgoraAudioFrame nearIn,
                                         AgoraAudioFrame farIn)

      Processes the given audio frame and returns the processed frame.
      Parameters:
        `nearIn` - The input audio frame to process.
        `farIn` - The input audio frame to process.
      Returns:
        The processed audio frame.

    - #### release

          public int release()

      Releases the resources held by the audio processor.
      Returns:
        0 if successful, or an error code otherwise.

    - #### nativeCreate

          private long nativeCreate()

      Native create method.
      Returns:
        Native pointer

    - #### nativeGetSdkVersion

          private static java.lang.String nativeGetSdkVersion()

      Native method to get SDK version.
      Returns:
        SDK version string

    - #### nativeInit

          private int nativeInit(long cptr,
                                 java.lang.String appId,
                                 java.lang.String license,
                                 IAgoraAudioProcessorEventHandler eventHandler,
                                 AgoraAudioProcessorConfig config)

      Native init method.
      Parameters:
        `cptr` - Native pointer
        `appId` - App ID
        `license` - License key
        `eventHandler` - Event handler
        `config` - Audio processor configuration
      Returns:
        Result code

    - #### nativeProcess

          private AgoraAudioFrame nativeProcess(long cptr,
                                                AgoraAudioFrame nearIn,
                                                AgoraAudioFrame farIn)

      Native process method.
      Parameters:
        `cptr` - Native pointer
        `nearIn` - Near-end audio frame
        `farIn` - Far-end audio frame
      Returns:
        Processed audio frame

    - #### nativeRelease

          private int nativeRelease(long cptr)

      Native release method.
      Parameters:
        `cptr` - Native pointer
      Returns:
        Result code