{"id":19976384,"url":"https://github.com/agoraio-extensions/agora-java-server-sdk","last_synced_at":"2025-09-23T07:00:02.897Z","repository":{"id":258114558,"uuid":"859738647","full_name":"AgoraIO-Extensions/Agora-Java-Server-SDK","owner":"AgoraIO-Extensions","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-09T09:30:18.000Z","size":106984,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-23T07:00:02.178Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AgoraIO-Extensions.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-19T07:40:42.000Z","updated_at":"2025-09-09T09:30:22.000Z","dependencies_parsed_at":"2024-12-23T12:32:31.149Z","dependency_job_id":"757fb4c4-3bab-4848-aad4-38fb7e6d96e6","html_url":"https://github.com/AgoraIO-Extensions/Agora-Java-Server-SDK","commit_stats":null,"previous_names":["agoraio-extensions/agora-java-server-sdk"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/AgoraIO-Extensions/Agora-Java-Server-SDK","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgoraIO-Extensions%2FAgora-Java-Server-SDK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgoraIO-Extensions%2FAgora-Java-Server-SDK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgoraIO-Extensions%2FAgora-Java-Server-SDK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgoraIO-Extensions%2FAgora-Java-Server-SDK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AgoraIO-Extensions","download_url":"https://codeload.github.com/AgoraIO-Extensions/Agora-Java-Server-SDK/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgoraIO-Extensions%2FAgora-Java-Server-SDK/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276531307,"owners_count":25658697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-23T02:00:09.130Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T03:23:27.896Z","updated_at":"2025-09-23T07:00:02.886Z","avatar_url":"https://github.com/AgoraIO-Extensions.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Agora Linux Server Java SDK\n\n[中文](./README.zh.md) | English\n\n## Table of Contents\n\n- [Agora Linux Server Java SDK](#agora-linux-server-java-sdk)\n  - [Table of Contents](#table-of-contents)\n  - [Introduction](#introduction)\n  - [Development Environment Requirements](#development-environment-requirements)\n    - [Hardware Environment](#hardware-environment)\n    - [Software Environment](#software-environment)\n  - [SDK Download](#sdk-download)\n    - [Maven Download](#maven-download)\n    - [CDN Download](#cdn-download)\n  - [Integrate the SDK](#integrate-the-sdk)\n    - [1. Maven Integration](#1-maven-integration)\n      - [1.1 Add Maven Dependency](#11-add-maven-dependency)\n      - [1.2 Integrate .so Library Files](#12-integrate-so-library-files)\n    - [2. Local SDK Integration](#2-local-sdk-integration)\n      - [2.1 SDK Package Structure](#21-sdk-package-structure)\n      - [2.2 Integrate JAR Files](#22-integrate-jar-files)\n          - [Local Maven Repository Method](#local-maven-repository-method)\n          - [Direct Reference Method](#direct-reference-method)\n      - [2.3 Integrate .so Library Files](#23-integrate-so-library-files)\n    - [3. Loading Native Libraries (.so Files)](#3-loading-native-libraries-so-files)\n      - [3.1 Extract .so Library Files](#31-extract-so-library-files)\n      - [3.2 Configure Loading Path](#32-configure-loading-path)\n  - [Quick Start](#quick-start)\n    - [Official Example Documentation](#official-example-documentation)\n    - [Enable Service](#enable-service)\n    - [Run Examples-Mvn Project](#run-examples-mvn-project)\n      - [Environment Preparation](#environment-preparation)\n      - [Project Configuration](#project-configuration)\n      - [Build Process](#build-process)\n      - [Running Examples](#running-examples)\n      - [Test Cases](#test-cases)\n  - [API Reference](#api-reference)\n    - [API Documentation Reference](#api-documentation-reference)\n    - [VAD Module](#vad-module)\n      - [VadV1 Module (Only supported by Gateway SDK)](#vadv1-module-only-supported-by-gateway-sdk)\n        - [Introduction](#introduction-1)\n        - [Classes and Methods](#classes-and-methods)\n          - [AgoraAudioVad Class](#agoraaudiovad-class)\n          - [AgoraAudioVadConfig Class](#agoraaudiovadconfig-class)\n        - [Usage Example](#usage-example)\n      - [VadV2 Module](#vadv2-module)\n        - [Introduction](#introduction-2)\n        - [Classes and Methods](#classes-and-methods-1)\n          - [AgoraAudioVadV2 Class](#agoraaudiovadv2-class)\n          - [AgoraAudioVadConfigV2 Properties](#agoraaudiovadconfigv2-properties)\n          - [Notes](#notes)\n          - [Methods](#methods)\n        - [VadProcessResult](#vadprocessresult)\n          - [Constructor](#constructor)\n        - [Usage Example](#usage-example-1)\n    - [Audio 3A Module (Only supported by Gateway SDK)](#audio-3a-module-only-supported-by-gateway-sdk)\n      - [Introduction](#introduction-3)\n      - [Classes and Methods](#classes-and-methods-2)\n        - [AgoraAudioProcessor Class](#agoraaudioprocessor-class)\n          - [Constructor](#constructor-1)\n          - [Methods](#methods-1)\n        - [AgoraAudioProcessorConfig Class](#agoraaudioprocessorconfig-class)\n          - [Methods](#methods-2)\n          - [Example](#example)\n        - [IAgoraAudioProcessorEventHandler Interface](#iagoraaudioprocessoreventhandler-interface)\n          - [Methods](#methods-3)\n        - [io.agora.rtc.audio3a.AgoraAudioFrame Class](#ioagorartcaudio3aagoraaudioframe-class)\n          - [Key Properties](#key-properties)\n          - [Main Methods (Setters/Getters)](#main-methods-settersgetters)\n      - [Usage Example](#usage-example-2)\n  - [Changelog](#changelog)\n    - [v4.4.32.101 (2025-09-01)](#v4432101-2025-09-01)\n    - [v4.4.32.100（2025-07-22）](#v44321002025-07-22)\n    - [v4.4.32.1 (2025-06-12)](#v44321-2025-06-12)\n      - [**API Changes**](#api-changes)\n      - [**Improvements \\\u0026 Optimizations**](#improvements--optimizations)\n    - [v4.4.32 (2025-05-27)](#v4432-2025-05-27)\n      - [**API Changes**](#api-changes-1)\n      - [**Improvements \\\u0026 Optimizations**](#improvements--optimizations-1)\n    - [v4.4.31.4 (2025-03-21)](#v44314-2025-03-21)\n      - [**Improvements \\\u0026 Optimizations**](#improvements--optimizations-2)\n    - [v4.4.31.3 (2025-02-26)](#v44313-2025-02-26)\n      - [**Improvements \\\u0026 Optimizations**](#improvements--optimizations-3)\n    - [v4.4.31.2 (2025-02-19)](#v44312-2025-02-19)\n      - [**API Changes**](#api-changes-2)\n      - [**Improvements \\\u0026 Optimizations**](#improvements--optimizations-4)\n    - [v4.4.31.1 (2025-01-06)](#v44311-2025-01-06)\n      - [**Improvements \\\u0026 Optimizations**](#improvements--optimizations-5)\n    - [v4.4.31 (2024-12-23)](#v4431-2024-12-23)\n      - [**API Changes**](#api-changes-3)\n      - [**Improvements \\\u0026 Optimizations**](#improvements--optimizations-6)\n    - [v4.4.30.2 (2024-11-20)](#v44302-2024-11-20)\n      - [**API Changes**](#api-changes-4)\n      - [**Improvements \\\u0026 Optimizations**](#improvements--optimizations-7)\n    - [v4.4.30.1 (2024-11-12)](#v44301-2024-11-12)\n      - [**API Changes**](#api-changes-5)\n      - [**Improvements \\\u0026 Optimizations**](#improvements--optimizations-8)\n    - [v4.4.30 (2024-10-24)](#v4430-2024-10-24)\n  - [Other References](#other-references)\n      - [**Improvements \\\u0026 Optimizations**](#improvements--optimizations-9)\n    - [v4.4.31.2 (2025-02-19)](#v44312-2025-02-19-1)\n      - [**API Changes**](#api-changes-6)\n      - [**Improvements \\\u0026 Optimizations**](#improvements--optimizations-10)\n    - [v4.4.31.1 (2025-01-06)](#v44311-2025-01-06-1)\n      - [**Improvements \\\u0026 Optimizations**](#improvements--optimizations-11)\n    - [v4.4.31 (2024-12-23)](#v4431-2024-12-23-1)\n      - [**API Changes**](#api-changes-7)\n      - [**Improvements \\\u0026 Optimizations**](#improvements--optimizations-12)\n    - [v4.4.30.2 (2024-11-20)](#v44302-2024-11-20-1)\n      - [**API Changes**](#api-changes-8)\n      - [**Improvements \\\u0026 Optimizations**](#improvements--optimizations-13)\n    - [v4.4.30.1 (2024-11-12)](#v44301-2024-11-12-1)\n      - [**API Changes**](#api-changes-9)\n      - [**Improvements \\\u0026 Optimizations**](#improvements--optimizations-14)\n    - [v4.4.30 (2024-10-24)](#v4430-2024-10-24-1)\n  - [Other References](#other-references-1)\n\n## Introduction\n\nThe Agora Linux Server Java SDK (v4.4.32.101) provides powerful real-time audio and video communication capabilities that can be seamlessly integrated into Linux server-side Java applications. With this SDK, your server can join Agora channels as a data source or processing node, accessing and processing audio and video streams in real-time to implement various business-related advanced features.\n\nThe Agora Linux Gateway SDK has not been released yet, and related features are currently not supported.\n\n\u003e Note: If you are upgrading from a version earlier than v4.4.32.100 to v4.4.32.100 or later, please refer to the [AIQoS Upgrade Guide](./AIQoS_Upgrade_Guide.md) for required API and integration changes.\n\n## Development Environment Requirements\n\n### Hardware Environment\n\n- **Operating System**: Ubuntu 18.04+ or CentOS 7.0+\n- **CPU Architecture**: x86-64\n- **Performance Requirements**:\n  - CPU: 8 cores @ 1.8 GHz or higher\n  - Memory: 2 GB (4 GB+ recommended)\n- **Network Requirements**:\n  - Public IP address\n  - Allow access to `.agora.io` and `.agoralab.co` domains\n\n### Software Environment\n\n- Apache Maven or other build tools\n- JDK 8+\n\n## SDK Download\n\n### Maven Download\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.agora.rtc\u003c/groupId\u003e\n    \u003cartifactId\u003elinux-java-sdk\u003c/artifactId\u003e\n    \u003cversion\u003e4.4.32.101\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### CDN Download\n\n[Agora-Linux-Java-SDK-v4.4.32.101-x86_64-860822-199c582312-20250901_154513](https://download.agora.io/sdk/release/Agora-Linux-Java-SDK-v4.4.32.101-x86_64-860822-199c582312-20250901_154513.zip)\n\n## Integrate the SDK\n\nThere are two ways to integrate the SDK: via Maven integration and local SDK integration.\n\n### 1. Maven Integration\n\nMaven integration is the simplest method, automatically managing Java dependencies.\n\n#### 1.1 Add Maven Dependency\n\nAdd the following dependency to your project's `pom.xml` file:\n\n```xml\n\u003c!-- x86_64 platform --\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.agora.rtc\u003c/groupId\u003e\n    \u003cartifactId\u003elinux-java-sdk\u003c/artifactId\u003e\n    \u003cversion\u003e4.4.32.101\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n#### 1.2 Integrate .so Library Files\n\nThe Maven dependency includes the required JAR files, but you still need to manually handle the `.so` library files to run the application. Please refer to the **Loading Native Libraries (.so Files)** section below.\n\n### 2. Local SDK Integration\n\nThe local SDK is a complete package containing all necessary files, suitable for scenarios requiring more flexible control.\n\n#### 2.1 SDK Package Structure\n\nThe SDK package (zip format) downloaded from the official website contains the following:\n\n- **doc/** - JavaDoc documentation, detailed API descriptions\n- **examples/** - Example code and projects\n- **sdk/** - Core SDK files\n  - `agora-sdk.jar` - Java library\n  - `agora-sdk-javadoc.jar` - JavaDoc documentation\n\n#### 2.2 Integrate JAR Files\n\nYou can integrate the JAR files in two ways:\n\n###### Local Maven Repository Method\n\nMethod 1: Install only the SDK JAR\n\n```sh\nmvn install:install-file \\\n  -Dfile=sdk/agora-sdk.jar \\\n  -DgroupId=io.agora.rtc \\\n  -DartifactId=linux-java-sdk \\\n  -Dversion=4.4.32.101 \\\n  -Dpackaging=jar \\\n  -DgeneratePom=true\n```\n\nMethod 2: Install both SDK JAR and JavaDoc JAR\n\n```sh\nmvn install:install-file \\\n  -Dfile=sdk/agora-sdk.jar \\\n  -DgroupId=io.agora.rtc \\\n  -DartifactId=linux-java-sdk \\\n  -Dversion=4.4.32.101 \\\n  -Dpackaging=jar \\\n  -DgeneratePom=true \\\n  -Djavadoc=sdk/agora-sdk-javadoc.jar\n```\n\nAfter installation, add the dependency to your `pom.xml`:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.agora.rtc\u003c/groupId\u003e\n    \u003cartifactId\u003elinux-java-sdk\u003c/artifactId\u003e\n    \u003cversion\u003e4.4.32.101\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n###### Direct Reference Method\n\n1. Copy the JAR files to your project's `libs` directory:\n\n   ```sh\n   mkdir -p libs\n   cp sdk/agora-sdk.jar libs/\n   cp sdk/agora-sdk-javadoc.jar libs/  # Optional, for IDE support\n   ```\n\n2. Add a classpath reference in your Java project:\n\n   ```sh\n   # Use the SDK JAR\n   java -cp .:libs/agora-sdk.jar YourMainClass\n\n   # Configure JavaDoc in your IDE (Common IDEs like IntelliJ IDEA or Eclipse support direct association of JavaDoc JARs)\n   ```\n\n#### 2.3 Integrate .so Library Files\n\nThe downloaded SDK package already contains the `.so` files. You need to ensure that the Java program can find these files at runtime. Please refer to the **Loading Native Libraries (.so Files)** section below.\n\n### 3. Loading Native Libraries (.so Files)\n\nThe Agora Linux Server Java SDK depends on underlying C++ native libraries (`.so` files). Whether integrating via Maven or locally, you must ensure the Java Virtual Machine (JVM) can find and load these libraries at runtime.\n\n#### 3.1 Extract .so Library Files\n\nThe `.so` files are contained within the `agora-sdk.jar` or `linux-java-sdk-x.x.x.x.jar` file. You need to extract them first:\n\n1.  Create a directory in your project or deployment location to store the library files, for example, `libs`:\n\n    ```sh\n    mkdir -p libs\n    cd libs\n    ```\n\n2.  Use the `jar` command to extract the contents from the SDK's JAR file (assuming the JAR file is in the `libs` directory or Maven cache):\n\n    ```sh\n    # If using local integration, the JAR file is typically in the libs directory\n    jar xvf agora-sdk.jar\n\n    # If using Maven integration, the JAR file is in the Maven cache, e.g.:\n    # jar xvf ~/.m2/repository/io/agora/rtc/linux-java-sdk/4.4.32.101/linux-java-sdk-4.4.32.101.jar\n    ```\n\n3.  After extraction, a `native/linux/x86_64` subdirectory will be generated within the `libs` directory, containing the required `.so` files:\n\n    ```\n    libs/\n    ├── agora-sdk.jar (or empty, if only used for extraction)\n    ├── io/          # Java class files, ignore\n    ├── META-INF/    # JAR and application metadata, ignore\n    └── native/      # Native libraries for corresponding platforms\n        └── linux/\n            └── x86_64/   # x86_64 platform .so libraries\n                ├── libagora_rtc_sdk.so\n                ├── libagora-fdkaac.so\n                ├── libaosl.so\n                └── libbinding.so\n    ```\n\n#### 3.2 Configure Loading Path\n\nThere are two main methods to help the JVM find the `.so` files:\n\n**Method 1: Setting the `LD_LIBRARY_PATH` Environment Variable (Recommended)**\n\nThis is the most reliable method, especially when there are dependencies between `.so` files.\n\n```sh\n# Determine the directory containing your .so files, assuming ./libs/native/linux/x86_64\nLIB_DIR=$(pwd)/libs/native/linux/x86_64\n\n# Set the LD_LIBRARY_PATH environment variable, adding the library directory to the beginning of the existing path\nexport LD_LIBRARY_PATH=$LIB_DIR:$LD_LIBRARY_PATH\n\n# Run your Java application\njava -jar YourApp.jar\n# Or using classpath\n# java -cp \"YourClasspath\" YourMainClass\n```\n\n**Method 2: Using the JVM Parameter `-Djava.library.path`**\n\nThis method directly tells the JVM where to look for library files.\n\n```sh\n# Determine the directory containing your .so files, assuming ./libs/native/linux/x86_64\nLIB_DIR=$(pwd)/libs/native/linux/x86_64\n\n# Run the Java application, specifying the library path via the -D parameter\njava -Djava.library.path=$LIB_DIR -jar YourApp.jar\n# Or using classpath\n# java -Djava.library.path=$LIB_DIR -cp \"YourClasspath\" YourMainClass\n```\n\n\u003e **Note**:\n\u003e\n\u003e - Method 1 (`LD_LIBRARY_PATH`) is recommended as it handles dependencies between libraries better. If only `-Djava.library.path` is used, loading might fail sometimes because a library cannot find its dependencies.\n\u003e - Ensure `$LIB_DIR` points to the **exact directory** containing files like `libagora_rtc_sdk.so`.\n\u003e - You can include the command to set the environment variable in a startup script for automatic configuration when running the application.\n\nRefer to the following script example, which combines both methods and sets the classpath:\n\n```sh\n#!/bin/bash\n# Get the absolute path of the directory where the script is located\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" \u0026\u0026 pwd)\"\n# Determine the .so library file path (assuming under libs/native/linux/x86_64 in the script directory)\nLIB_PATH=\"$SCRIPT_DIR/libs/native/linux/x86_64\"\n# SDK JAR path (assuming under libs in the script directory)\nSDK_JAR=\"$SCRIPT_DIR/libs/agora-sdk.jar\"\n# Your application's main class\nMAIN_CLASS=\"YourMainClass\"\n# Your application's other dependency classpath (if any)\nAPP_CP=\"YourOtherClasspath\"\n\n# Set the library path environment variable\nexport LD_LIBRARY_PATH=$LIB_PATH:$LD_LIBRARY_PATH\n\n# Combine the classpath\nCLASSPATH=\".:$SDK_JAR:$APP_CP\" # '.' represents the current directory\n\n# Execute the Java program\n# Use both LD_LIBRARY_PATH and -Djava.library.path for compatibility\njava -Djava.library.path=$LIB_PATH -cp \"$CLASSPATH\" $MAIN_CLASS\n```\n\n## Quick Start\n\n### Official Example Documentation\n\nRefer to the [Official Example Documentation](https://docs.agora.io/en/rtc-server-sdk/java/get-started/run-example/)\n\n### Enable Service\n\nRefer to [Official Service Activation Guide](https://docs.agora.io/en/rtc-server-sdk/java/get-started/enable-service/)\n\n### Run Examples-Mvn Project\n\n**Examples-Mvn** is a Maven example project built on the Spring Boot framework, providing a complete RESTful API service to demonstrate various features of the Agora Linux Server Java SDK.\n\nThis project has integrated C++ code compilation functionality, which can automatically compile and generate required .so library files during the Maven build process.\n\n#### Environment Preparation\n\n1. **Install Maven Build Tool**\n\n   Refer to [Maven Installation Guide](https://maven.apache.org/install.html)\n\n   ```bash\n   sudo apt-get install maven -y\n   sudo apt-get install lsof -y\n   ```\n\n2. **C++ Compilation Environment (if native library compilation is needed)**\n\n   Install basic compilation tools:\n   ```bash\n   sudo apt-get update\n   sudo apt-get install build-essential pkg-config gcc g++\n   ```\n\n3. **Install C++ Runtime Library**\n\n   The native libraries of the SDK depend on the `libc++` runtime. Please install it to avoid link errors:\n   ```bash\n   sudo apt-get install libc++1\n   ```\n\n4. **FFmpeg Dependencies (if FFmpeg features need to be compiled)**\n\n   ```bash\n   sudo apt-get install libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev\n   ```\n\n5. **Ensure JAVA_HOME is set correctly**\n\n   ```bash\n   export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64\n   ```\n\n#### Project Configuration\n\n1. Enter the `Examples-Mvn` directory:\n\n   ```bash\n   cd Examples-Mvn\n   ```\n\n2. Create a `.keys` file and add:\n\n   ```\n   APP_ID=your_app_id\n   TOKEN=your_token\n   ```\n\n   _If certificates are not enabled, the TOKEN value can be empty, e.g.:_\n\n   ```\n   APP_ID=abcd1234\n   TOKEN=\n   ```\n\n   If Gateway SDK is supported, create a `.keys_gateway` file and add:\n\n   ```\n   APP_ID=your_app_id\n   LICENSE=your_license\n   ```\n\n3. **Runtime Configuration (run_config)**\n\n   The `run_config` file is used to configure various runtime options, located at `Examples-Mvn/run_config`. You can modify the following configurations as needed:\n\n   | Configuration  | Type    | Default | Description                                                                          |\n   | -------------- | ------- | ------- | ------------------------------------------------------------------------------------ |\n   | enable_asan    | boolean | false   | Whether to enable AddressSanitizer for memory error detection                        |\n   | enable_gateway | boolean | false   | Whether to enable Gateway SDK mode, which allows access to VAD and Audio 3A features |\n\n   **Configuration Example:**\n\n   ```bash\n   # Enable Gateway SDK functionality\n   enable_gateway=true\n  \n   # Enable memory checking (debug mode)\n   enable_asan=true\n   ```\n\n   \u003e **Note**:\n   \u003e - The project needs to be recompiled after modifying the configuration.\n\n4. **Configure Java SDK**\n\n    This section describes how to configure the Linux Java SDK dependency for your Maven project.\n\n    **Step 1: Configure JAR Dependency**\n\n    You have two ways to configure the project's JAR dependency:\n\n    **Method 1: Using Maven Central Repository (Recommended)**\n    \n    If your project can directly fetch dependencies from the Maven Central Repository, ensure that the correct version number is configured in `pom.xml`.\n    ```xml\n    \u003cdependency\u003e\n        \u003cgroupId\u003eio.agora.rtc\u003c/groupId\u003e\n        \u003cartifactId\u003elinux-java-sdk\u003c/artifactId\u003e\n        \u003cversion\u003e4.4.32.101\u003c/version\u003e  \u003c!-- Ensure the version number is consistent with the one you need to use --\u003e\n    \u003c/dependency\u003e\n    ```\n\n    **Method 2: Using a Local SDK Package**\n    \n    If you need to use a local SDK package (e.g., a customized or internal version), follow these steps:\n\n    1.  **Place SDK Artifacts**: Place the downloaded SDK JAR package (e.g., `agora-sdk.jar`) and the corresponding Javadoc package (`agora-sdk-javadoc.jar`) into the `Examples-Mvn/libs/` directory.\n\n    2.  **Install to Local Maven Repository**: In the `linux_server_java` directory, execute the following script. This script will install the JAR files from the `libs` directory as Maven artifacts into your local repository (usually located at `~/.m2/repository`).\n        ```bash\n        ./build_install_local_maven.sh\n        ```\n    3.  **Update Project Dependencies**: In your project's `pom.xml` (e.g., `Examples-Mvn`), update the version of the `linux-java-sdk` dependency to match the version you installed locally.\n\n\n    **Step 2: Configure Native Libraries (`.so`)**\n    \n    To ensure the Java program can successfully load the native libraries (`.so` files) at runtime, you need to place them in the specified path.\n\n    1.  **Enter the `libs` directory**:\n        ```bash\n        cd linux_server_java/Examples-Mvn/libs/\n        ```\n\n    2.  **Extract Native Libraries from JAR**:\n        ```bash\n        # -x: extract, -v: verbose, -f: file\n        jar -xvf agora-sdk.jar native/\n        ```\n        This command extracts the `native` directory from `agora-sdk.jar`, which contains the native libraries for all platforms.\n\n    3.  **Verify Directory Structure**:\n        After extraction, the `libs` directory structure should be as follows, ensuring the `.so` files are located under the `native/linux/x86_64/` path:\n        ```text\n        libs/\n        ├── agora-sdk.jar\n        ├── agora-sdk-javadoc.jar\n        └── native/\n            └── linux/\n                └── x86_64/\n                    ├── libagora_rtc_sdk.so\n                    ├── libagora-fdkaac.so\n                    └── ... (other .so files)\n        ```\n    4.  **Return to the project root directory**:\n        ```bash\n        cd ../../..\n        ```\n\n#### Build Process\n\nExecute the build script:\n\n```bash\n# Standard Maven build (without compiling native code)\n./build.sh\n\n# Compile and start service\n./build.sh start\n\n# Compile all native libraries\n./build.sh -native\n\n# Compile all native libraries and start service\n./build.sh -native start\n\n# Compile only FFmpeg-related libraries\n./build.sh -ffmpegUtils\n\n# Compile only Media-related libraries\n./build.sh -mediaUtils\n```\n\n**Build Options:**\n- By default, only compiles the Java project without compiling C++ code\n- Use `-native` option to compile all native libraries (FFmpeg + Media)\n- Use `-ffmpegUtils` option to compile only FFmpeg-related libraries (for MP4 processing)\n- Use `-mediaUtils` option to compile only Media-related libraries (for encoded audio/video processing)\n- Use `start` option to automatically start the service after compilation\n\n**Using Maven Commands:**\n\nYou can also use Maven commands directly:\n\n```bash\n# Compile all native libraries\nmvn clean package -Dbuild.native=true\n\n# Compile only FFmpeg libraries\nmvn clean package -Dbuild.ffmpeg=true\n\n# Compile only Media libraries\nmvn clean package -Dbuild.media=true\n```\n\n#### Running Examples\n\nAfter starting the service, use a browser or Postman to access the following interface addresses to test various features:\n\n**Basic Feature Test Interface:**\n```\nhttp://localhost:18080/api/server/basic?taskName=ReceiverPcmDirectSendTest\nhttp://localhost:18080/api/server/basic?taskName=ReceiverPcmH264Test\nhttp://localhost:18080/api/server/basic?taskName=ReceiverPcmVadTest\nhttp://localhost:18080/api/server/basic?taskName=ReceiverPcmYuvTest\nhttp://localhost:18080/api/server/basic?taskName=SendH264Test\nhttp://localhost:18080/api/server/basic?taskName=SendMp4Test\nhttp://localhost:18080/api/server/basic?taskName=SendOpusTest\nhttp://localhost:18080/api/server/basic?taskName=SendPcmFileTest\nhttp://localhost:18080/api/server/basic?taskName=SendPcmRealTimeTest\nhttp://localhost:18080/api/server/basic?taskName=SendReceiverStreamMessageTest\nhttp://localhost:18080/api/server/basic?taskName=SendYuvTest\n```\n\n**Gateway SDK Exclusive Features:**\n```\nhttp://localhost:18080/api/server/basic?taskName=VadV1Test\nhttp://localhost:18080/api/server/basic?taskName=Audio3aTest\n```\n\n**Configuration File Interface:**\n```\nhttp://localhost:18080/api/server/start?configFileName=pcm_send.json\n```\n\n\u003e **Note**: Replace `localhost:18080` with your actual server address and port.\n\n#### Test Cases\n\n- Send PCM Audio\n\n  Refer to [SendPcmFileTest.java](./Examples-Mvn/src/main/java/io/agora/rtc/example/basic/SendPcmFileTest.java), implement looping PCM file sending\n\n  Refer to [SendPcmRealTimeTest.java](./Examples-Mvn/src/main/java/io/agora/rtc/example/basic/SendPcmRealTimeTest.java), implement streaming PCM data sending\n\n- Send YUV Video\n\n  Refer to [SendYuvTest.java](./Examples-Mvn/src/main/java/io/agora/rtc/example/basic/SendYuvTest.java), implement streaming YUV data sending\n\n- Send H264 Video\n\n  Refer to [SendH264Test.java](./Examples-Mvn/src/main/java/io/agora/rtc/example/basic/SendH264Test.java), implement streaming H264 data sending\n\n- Send Opus Audio\n\n  Refer to [SendOpusTest.java](./Examples-Mvn/src/main/java/io/agora/rtc/example/basic/SendOpusTest.java), implement streaming Opus data sending\n\n- Send MP4 Audio/Video\n\n  Refer to [SendMp4Test.java](./Examples-Mvn/src/main/java/io/agora/rtc/example/basic/SendMp4Test.java), implement MP4 file sending\n\n- Receive PCM Audio\n\n  Refer to [ReceiverPcmVadTest.java](./Examples-Mvn/src/main/java/io/agora/rtc/example/basic/ReceiverPcmVadTest.java), implement receiving PCM data with VAD data\n\n  Refer to [ReceiverPcmDirectSendTest.java](./Examples-Mvn/src/main/java/io/agora/rtc/example/basic/ReceiverPcmDirectSendTest.java), implement receiving PCM data and directly sending back\n\n- Receive PCM\u0026H264 Audio/Video\n\n  Refer to [ReceiverPcmH264Test.java](./Examples-Mvn/src/main/java/io/agora/rtc/example/basic/ReceiverPcmH264Test.java), implement receiving PCM \u0026 H264 data\n\n- Receive PCM\u0026YUV Audio/Video\n\n  Refer to [ReceiverPcmYuvTest.java](./Examples-Mvn/src/main/java/io/agora/rtc/example/basic/ReceiverPcmYuvTest.java), implement receiving PCM \u0026 YUV data\n\n- Send/Receive Stream Messages\n\n  Refer to [SendReceiverStreamMessageTest.java](./Examples-Mvn/src/main/java/io/agora/rtc/example/basic/SendReceiverStreamMessageTest.java), implement sending and receiving stream messages\n\n- VadV1 Module (Only supported by Gateway SDK)\n\n  Refer to [VadV1Test.java](./Examples-Mvn/src/main/java/io/agora/rtc/example/basic/VadV1Test.java.disabled), implement VadV1 module functionality\n\n- Audio 3A Processing (Only supported by Gateway SDK)\n\n  Refer to [Audio3aTest.java](./Examples-Mvn/src/main/java/io/agora/rtc/example/basic/Audio3aTest.java.disabled), implement audio 3A processing functionality\n\n## API Reference\n\n### API Documentation Reference\n\nFor complete API documentation, refer to the following resources:\n\n- [API-reference.md](./API-reference.md) file (For reference only, based on the Chinese version)\n- Official Documentation [Agora Java Server SDK API Reference](https://docs.agora.io/en/rtc-server-sdk/java/reference/api-overview/) (Official documentation takes precedence)\n\n### VAD Module\n\n#### VadV1 Module (Only supported by Gateway SDK)\n\n##### Introduction\n\n`AgoraAudioVad` is a Voice Activity Detection (VAD) module for processing audio frames. It detects speech activity in an audio stream and processes it based on configuration parameters. This module is the first version of VAD, providing basic voice activity detection functionality.\n\n##### Classes and Methods\n\n###### AgoraAudioVad Class\n\n**Constructor**\n\n```java\npublic AgoraAudioVad()\n```\n\n- **Description**: Constructs an `AgoraAudioVad` instance.\n\n**Methods**\n\n```java\npublic int initialize(AgoraAudioVadConfig config)\n```\n\n- **Description**: Initializes the VAD module. This must be called before using other methods.\n- **Parameters**:\n  - `config`: `AgoraAudioVadConfig` type, VAD configuration.\n- **Returns**: `int`, 0 for success, -1 for failure.\n\n```java\npublic VadProcessResult processPcmFrame(byte[] frame)\n```\n\n- **Description**: Processes PCM audio frames.\n- **Parameters**:\n  - `frame`: `byte[]` type, PCM audio data.\n- **Returns**: `VadProcessResult` type, VAD processing result.\n\n```java\npublic synchronized void destroy()\n```\n\n- **Description**: Destroys the VAD module and releases resources.\n\n###### AgoraAudioVadConfig Class\n\n**Main Properties**\n\n| Property Name          | Type  | Description                                           | Default | Range                  |\n| ---------------------- | ----- | ----------------------------------------------------- | ------- | ---------------------- |\n| fftSz                  | int   | FFT size, supports only 128, 256, 512, 1024           | 1024    | [128, 256, 512, 1024]  |\n| hopSz                  | int   | FFT hop size, used for checking                       | 160     | [1, Integer.MAX_VALUE] |\n| anaWindowSz            | int   | FFT window size, used for calculating RMS             | 768     | [1, Integer.MAX_VALUE] |\n| voiceProbThr           | float | Voice probability threshold                           | 0.8     | [0.0, 1.0]             |\n| rmsThr                 | float | RMS threshold (dB)                                    | -40.0   | [-100.0, 0.0]          |\n| jointThr               | float | Joint threshold (dB)                                  | 0.0     | [-100.0, 100.0]        |\n| aggressive             | float | Aggressive factor, higher value means more aggressive | 5.0     | [0.0, 10.0]            |\n| startRecognizeCount    | int   | Start recognition count                               | 10      | [1, Integer.MAX_VALUE] |\n| stopRecognizeCount     | int   | Stop recognition count                                | 6       | [1, Integer.MAX_VALUE] |\n| preStartRecognizeCount | int   | Pre-start recognition count                           | 10      | [0, Integer.MAX_VALUE] |\n| activePercent          | float | Active percentage                                     | 0.6     | [0.0, 1.0]             |\n| inactivePercent        | float | Inactive percentage                                   | 0.2     | [0.0, 1.0]             |\n\n##### Usage Example\n\nHere is a simple example showing how to use `AgoraAudioVad` for audio frame processing:\n\n```java\nimport io.agora.rtc.AgoraAudioVad;\nimport io.agora.rtc.AgoraAudioVadConfig;\nimport io.agora.rtc.VadProcessResult;\nimport java.io.FileInputStream;\n\npublic class VadV1Example {\n    public static void main(String[] args) {\n        // Create VAD instance\n        AgoraAudioVad audioVad = new AgoraAudioVad();\n        \n        // Create configuration\n        AgoraAudioVadConfig config = new AgoraAudioVadConfig();\n        // Configure parameters as needed, recommend using default values\n        \n        // Initialize VAD\n        int ret = audioVad.initialize(config);\n        if (ret != 0) {\n            System.err.println(\"Failed to initialize VAD: \" + ret);\n            return;\n        }\n        \n        // Process audio frames\n        try {\n            // Assume we have PCM audio data\n            byte[] pcmData = new byte[320]; // 10ms 16kHz mono PCM16 data\n            \n            VadProcessResult result = audioVad.processPcmFrame(pcmData);\n            if (result != null) {\n                System.out.println(\"VAD State: \" + result.getState());\n                if (result.getOutFrame() != null) {\n                    System.out.println(\"Output Frame Length: \" + result.getOutFrame().length);\n                }\n            }\n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n        \n        // Destroy VAD instance\n        audioVad.destroy();\n    }\n}\n```\n\n#### VadV2 Module\n\n##### Introduction\n\n`AgoraAudioVadV2` is the second version of the Voice Activity Detection (VAD) module for processing audio frames. It detects speech activity in an audio stream and processes it based on configuration parameters.\n\n##### Classes and Methods\n\n###### AgoraAudioVadV2 Class\n\n**Constructor**\n\n```java\npublic AgoraAudioVadV2(AgoraAudioVadConfigV2 config)\n```\n\n- **Parameters**\n  - `config`: `AgoraAudioVadConfigV2` type, VAD configuration.\n\n###### AgoraAudioVadConfigV2 Properties\n\n| Property Name          | Type  | Description                                                         | Default | Range                  |\n| ---------------------- | ----- | ------------------------------------------------------------------- | ------- | ---------------------- |\n| preStartRecognizeCount | int   | Number of audio frames saved before entering speaking state         | 16      | [0, Integer.MAX_VALUE] |\n| startRecognizeCount    | int   | Number of audio frames to confirm speaking state                    | 30      | [1, Integer.MAX_VALUE] |\n| stopRecognizeCount     | int   | Number of audio frames to confirm stop speaking state               | 20      | [1, Integer.MAX_VALUE] |\n| activePercent          | float | Percentage of active frames required in startRecognizeCount frames  | 0.7     | [0.0, 1.0]             |\n| inactivePercent        | float | Percentage of inactive frames required in stopRecognizeCount frames | 0.5     | [0.0, 1.0]             |\n| startVoiceProb         | int   | Probability threshold to start voice detection                      | 70      | [0, 100]               |\n| stopVoiceProb          | int   | Probability threshold to stop voice detection                       | 70      | [0, 100]               |\n| startRmsThreshold      | int   | RMS threshold (dBFS) to start voice detection                       | -50     | [-100, 0]              |\n| stopRmsThreshold       | int   | RMS threshold (dBFS) to stop voice detection                        | -50     | [-100, 0]              |\n\n###### Notes\n\n- `startVoiceProb`: Lower value means higher probability of a frame being judged active, starting the phase earlier. Lower it for more sensitive detection.\n- `stopVoiceProb`: Higher value means higher probability of a frame being judged inactive, ending the phase earlier. Raise it for quicker end detection.\n- `startRmsThreshold` \u0026 `stopRmsThreshold`:\n  - Higher value means more sensitive to voice activity.\n  - Default -50 is recommended for quiet environments.\n  - In noisy environments, adjust between -40 and -30 to reduce false positives.\n  - Fine-tune based on the actual usage scenario and audio characteristics for optimal results.\n\n###### Methods\n\n```java\npublic synchronized VadProcessResult processFrame(AudioFrame frame)\n```\n\n- **Parameters**\n  - `frame`: `AudioFrame` type, the audio frame.\n- **Returns**\n  - `VadProcessResult` type, the VAD processing result.\n\n```java\npublic synchronized void destroy()\n```\n\n- Destroys the VAD module and releases resources.\n\n##### VadProcessResult\n\nStores the result of VAD processing.\n\n###### Constructor\n\n```java\npublic VadProcessResult(byte[] result, Constants.VadState state)\n```\n\n- **Parameters**\n  - `result`: `byte[]` type, the processed audio data.\n  - `state`: `Constants.VadState` type, the current VAD state.\n\n##### Usage Example\n\nHere is a simple example showing how to use `AgoraAudioVadV2` for audio frame processing:\n\n```java\nimport io.agora.rtc.AgoraAudioVadV2;\nimport io.agora.rtc.AgoraAudioVadConfigV2;\nimport io.agora.rtc.Constants;\nimport io.agora.rtc.AudioFrame;\nimport io.agora.rtc.VadProcessResult;\n\npublic class VadV2Example {\n    public static void main(String[] args) {\n        // Create VAD configuration\n        AgoraAudioVadConfigV2 config = new AgoraAudioVadConfigV2();\n        config.setPreStartRecognizeCount(16);\n        config.setStartRecognizeCount(30);\n        config.setStopRecognizeCount(20);\n        config.setActivePercent(0.7f);\n        config.setInactivePercent(0.5f);\n        config.setStartVoiceProb(70);\n        config.setStopVoiceProb(70);\n        config.setStartRmsThreshold(-50);\n        config.setStopRmsThreshold(-50);\n\n        // Create VAD instance\n        AgoraAudioVadV2 vad = new AgoraAudioVadV2(config);\n\n        // Simulate audio frame processing\n        AudioFrame frame = new AudioFrame();\n        // Set frame properties...\n\n        VadProcessResult result = vad.processFrame(frame);\n        if (result != null) {\n            System.out.println(\"VAD State: \" + result.getState());\n            // Assuming getResult() exists on VadProcessResult (based on constructor)\n            // System.out.println(\"Processed Data Length: \" + result.getResult().length);\n            System.out.println(\"Processed Data Length: \" + result.getOutFrame().length); // Using getOutFrame based on API Ref\n        }\n\n        // Destroy VAD instance\n        vad.destroy();\n    }\n}\n```\n\n### Audio 3A Module (Only supported by Gateway SDK)\n\n#### Introduction\n\nThe `AgoraAudioProcessor` is a module designed for Audio 3A processing and Background Human Voice Suppression (BGHVS), which includes Acoustic Echo Cancellation (AEC), Automatic Noise Suppression (ANS), Automatic Gain Control (AGC), and Background Human Voice Suppression (BGHVS). It processes audio frames to enhance audio quality by mitigating echo, reducing noise, normalizing volume levels, and suppressing background human voices. This module requires corresponding model files to perform its processing tasks.\n\n#### Classes and Methods\n\n##### AgoraAudioProcessor Class\n\n###### Constructor\n\n```java\npublic AgoraAudioProcessor()\n```\n\n- **Description**: Constructs an `AgoraAudioProcessor` instance.\n\n###### Methods\n\n```java\npublic int init(String appId, String license, IAgoraAudioProcessorEventHandler eventHandler, AgoraAudioProcessorConfig config)\n```\n\n- **Description**: Initializes the audio processor. This must be called before any other methods.\n- **Parameters**:\n  - `appId`: `String`, your App ID obtained from Agora Console.\n  - `license`: `String`, your License key obtained from Agora Console.\n  - `eventHandler`: `IAgoraAudioProcessorEventHandler`, a callback handler to receive processor events and errors.\n  - `config`: `AgoraAudioProcessorConfig`, the 3A processor configuration object, used for setting the model path, etc.\n- **Returns**: `int`, 0 for success, other values indicate failure.\n\n```java\npublic AgoraAudioFrame process(AgoraAudioFrame nearIn)\n```\n\n- **Description**: Performs 3A processing (e.g., ANS, AGC) on the input near-end audio frame. Use this method when processing only near-end audio or when AEC is not required.\n- **Parameters**:\n  - `nearIn`: `io.agora.rtc.audio3a.AgoraAudioFrame`, the frame object containing near-end PCM audio data to be processed.\n- **Returns**: `io.agora.rtc.audio3a.AgoraAudioFrame`, the processed audio frame. May return `null` if processing fails.\n\n```java\npublic AgoraAudioFrame process(AgoraAudioFrame nearIn, AgoraAudioFrame farIn)\n```\n\n- **Description**: Performs 3A processing (e.g., AEC, ANS, AGC) on the input near-end and far-end audio frames. Use this method when Acoustic Echo Cancellation (AEC) or other processing that requires both near-end and far-end audio is needed.\n- **Parameters**:\n  - `nearIn`: `io.agora.rtc.audio3a.AgoraAudioFrame`, the frame object containing near-end PCM audio data to be processed.\n  - `farIn`: `io.agora.rtc.audio3a.AgoraAudioFrame`, the frame object containing far-end PCM audio data for reference, primarily used for Acoustic Echo Cancellation (AEC).\n- **Returns**: `io.agora.rtc.audio3a.AgoraAudioFrame`, the processed near-end audio frame. May return `null` if processing fails.\n\n```java\npublic int release()\n```\n\n- **Description**: Releases all resources occupied by the `AgoraAudioProcessor` instance. This should be called when processing is complete.\n- **Returns**: `int`, 0 for success, other values indicate failure.\n\n##### AgoraAudioProcessorConfig Class\n\nThis class is used to configure the `AgoraAudioProcessor`.\n\n###### Methods\n\n```java\npublic void setModelPath(String modelPath)\n```\n\n- **Description**: Sets the path to the model files required for 3A processing. Model files are typically provided with the SDK package, often in a `resources/model/` directory.\n- **Parameters**:\n  - `modelPath`: `String`, the directory path where model files are located. For example, `./resources/model/`.\n\n```java\npublic void setAecConfig(AecConfig aecConfig)\npublic AecConfig getAecConfig()\n```\n\n- **Description**: Sets and gets the Acoustic Echo Cancellation (AEC) configuration.\n- **Parameters**:\n  - `aecConfig`: `AecConfig` type, the AEC configuration object.\n\n```java\npublic void setAnsConfig(AnsConfig ansConfig)\npublic AnsConfig getAnsConfig()\n```\n\n- **Description**: Sets and gets the Automatic Noise Suppression (ANS) configuration.\n- **Parameters**:\n  - `ansConfig`: `AnsConfig` type, the ANS configuration object.\n\n```java\npublic void setAgcConfig(AgcConfig agcConfig)\npublic AgcConfig getAgcConfig()\n```\n\n- **Description**: Sets and gets the Automatic Gain Control (AGC) configuration.\n- **Parameters**:\n  - `agcConfig`: `AgcConfig` type, the AGC configuration object.\n\n```java\npublic void setBghvsConfig(BghvsConfig bghvsConfig)\npublic BghvsConfig getBghvsConfig()\n```\n\n- **Description**: Sets and gets the Background Human Voice Suppression (BGHVS) configuration.\n- **Parameters**:\n  - `bghvsConfig`: `BghvsConfig` type, the BGHVS configuration object.\n\n###### Example\n\n```java\nAgoraAudioProcessorConfig config = new AgoraAudioProcessorConfig();\nconfig.setModelPath(\"./resources/model/\"); // Set according to the actual model file location\n\n// Configure AEC\nAecConfig aecConfig = new AecConfig();\naecConfig.setEnabled(true);\nconfig.setAecConfig(aecConfig);\n\n// Configure ANS\nAnsConfig ansConfig = new AnsConfig();\nansConfig.setEnabled(true);\nconfig.setAnsConfig(ansConfig);\n\n// Configure AGC\nAgcConfig agcConfig = new AgcConfig();\nagcConfig.setEnabled(true);\nconfig.setAgcConfig(agcConfig);\n\n// Configure BGHVS\nBghvsConfig bghvsConfig = new BghvsConfig();\nbghvsConfig.setEnabled(true);\nconfig.setBghvsConfig(bghvsConfig);\n```\n\n##### IAgoraAudioProcessorEventHandler Interface\n\nThis interface is used to receive event and error notifications from the `AgoraAudioProcessor`.\n\n###### Methods\n\n```java\npublic void onEvent(Constants.AgoraAudioProcessorEventType eventType)\n```\n\n- **Description**: Reports events that occur during processor operation.\n- **Parameters**:\n  - `eventType`: `io.agora.rtc.Constants.AgoraAudioProcessorEventType`, the specific event type.\n\n```java\npublic void onError(int errorCode)\n```\n\n- **Description**: Reports errors that occur during processor operation.\n- **Parameters**:\n  - `errorCode`: `int`, the error code indicating the specific error that occurred.\n\n\n##### io.agora.rtc.audio3a.AgoraAudioFrame Class\n\nThis class is used to encapsulate audio data for processing by `AgoraAudioProcessor`. (Note: This might be different from `io.agora.rtc.AudioFrame`; use the version from the `audio3a` package).\n\n###### Key Properties\n\n| Property Name     | Type       | Description                                                                                                             |\n| ----------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------- |\n| type              | int        | Audio frame type, typically `Constants.AudioFrameType.PCM16.getValue()`.                                                |\n| sampleRate        | int        | Audio sample rate (Hz), e.g., 16000, 32000, 48000.                                                                      |\n| channels          | int        | Number of audio channels, e.g., 1 (mono) or 2 (stereo).                                                                 |\n| samplesPerChannel | int        | Number of samples per channel. For a 10ms frame, this is usually `sampleRate / 100`.                                    |\n| bytesPerSample    | int        | Number of bytes per sample. E.g., for PCM16, it's 2 bytes (`Constants.BytesPerSample.TWO_BYTES_PER_SAMPLE.getValue()`). |\n| buffer            | ByteBuffer | `java.nio.ByteBuffer` containing the raw PCM audio data.                                                                |\n\n###### Main Methods (Setters/Getters)\n\n```java\npublic void setType(int type);\npublic int getType();\n\npublic void setSampleRate(int sampleRate);\npublic int getSampleRate();\n\npublic void setChannels(int channels);\npublic int getChannels();\n\npublic void setSamplesPerChannel(int samplesPerChannel);\npublic int getSamplesPerChannel();\n\npublic void setBytesPerSample(int bytesPerSample);\npublic int getBytesPerSample();\n\npublic void setBuffer(java.nio.ByteBuffer buffer);\npublic java.nio.ByteBuffer getBuffer();\n```\n\n#### Usage Example\n\nBelow is a simple example demonstrating how to use `AgoraAudioProcessor` for audio frame processing:\n\n```java\nimport io.agora.rtc.audio3a.AgoraAudioProcessor;\nimport io.agora.rtc.audio3a.AgoraAudioProcessorConfig;\nimport io.agora.rtc.audio3a.IAgoraAudioProcessorEventHandler;\nimport io.agora.rtc.audio3a.AgoraAudioFrame; // Use AgoraAudioFrame from the audio3a package\nimport io.agora.rtc.audio3a.AecConfig;\nimport io.agora.rtc.audio3a.AnsConfig;\nimport io.agora.rtc.audio3a.AgcConfig;\nimport io.agora.rtc.audio3a.BghvsConfig;\nimport io.agora.rtc.Constants; // SDK's constants class\nimport java.nio.ByteBuffer;\nimport java.util.Arrays; // For printing data in example\n\npublic class Audio3AProcessingExample {\n    public static void main(String[] args) {\n        // Replace with your App ID and License\n        String appId = \"YOUR_APP_ID\";\n        String license = \"YOUR_LICENSE_KEY\";\n\n        // 1. Create AgoraAudioProcessor instance\n        AgoraAudioProcessor audioProcessor = new AgoraAudioProcessor();\n\n        // 2. Configure AgoraAudioProcessorConfig\n        AgoraAudioProcessorConfig config = new AgoraAudioProcessorConfig();\n        // Set the model file path, usually in resources/model/ of the SDK package\n        // Ensure the path is correct, otherwise initialization might fail\n        config.setModelPath(\"./resources/model/\"); // Modify according to your actual path\n\n        // Configure AEC (Acoustic Echo Cancellation)\n        AecConfig aecConfig = config.getAecConfig();\n        aecConfig.setEnabled(true); // Enable AEC\n        \n        // Configure ANS (Automatic Noise Suppression)\n        AnsConfig ansConfig = config.getAnsConfig();\n        ansConfig.setEnabled(true); // Enable ANS\n        \n        // Configure AGC (Automatic Gain Control)\n        AgcConfig agcConfig = config.getAgcConfig();\n        agcConfig.setEnabled(true); // Enable AGC\n        \n        // Configure BGHVS (Background Human Voice Suppression)\n        BghvsConfig bghvsConfig = config.getBghvsConfig();\n        bghvsConfig.setEnabled(true); // Enable BGHVS\n\n        // 3. Initialize AgoraAudioProcessor\n        int initRet = audioProcessor.init(appId, license,\n                new IAgoraAudioProcessorEventHandler() {\n                    @Override\n                    public void onEvent(Constants.AgoraAudioProcessorEventType eventType) {\n                        System.out.println(\"AgoraAudioProcessor Event: \" + eventType);\n                    }\n\n                    @Override\n                    public void onError(int errorCode) {\n                        System.err.println(\"AgoraAudioProcessor Error: \" + errorCode);\n                    }\n                }, config);\n\n        if (initRet != 0) {\n            System.err.println(\"Failed to initialize AgoraAudioProcessor. Error code: \" + initRet);\n            // Handle initialization failure based on the error code, e.g., check appId, license, modelPath\n            return;\n        }\n        System.out.println(\"AgoraAudioProcessor initialized successfully.\");\n\n        // 4. Prepare audio frame (AgoraAudioFrame)\n        // Example parameters: 48kHz, mono, 10ms audio frame\n        int sampleRate = 48000;\n        int channels = 1;\n        int samplesPerChannel = sampleRate / 100; // 10ms frame -\u003e 480 samples\n        int bytesPerSample = Constants.BytesPerSample.TWO_BYTES_PER_SAMPLE.getValue(); // PCM16\n        int bufferSize = samplesPerChannel * channels * bytesPerSample;\n\n        // Create near-end audio frame\n        AgoraAudioFrame nearInFrame = new AgoraAudioFrame();\n        nearInFrame.setType(Constants.AudioFrameType.PCM16.getValue());\n        nearInFrame.setSampleRate(sampleRate);\n        nearInFrame.setChannels(channels);\n        nearInFrame.setSamplesPerChannel(samplesPerChannel);\n        nearInFrame.setBytesPerSample(bytesPerSample);\n        // In a real application, pcmDataNear would come from a near-end audio source\n        byte[] pcmDataNear = new byte[bufferSize]; \n        // ... Fill pcmDataNear with dummy data here ...\n        ByteBuffer nearAudioBuffer = ByteBuffer.allocateDirect(bufferSize);\n        nearAudioBuffer.put(pcmDataNear);\n        nearAudioBuffer.flip();\n        nearInFrame.setBuffer(nearAudioBuffer);\n\n        // Create far-end audio frame (for AEC)\n        AgoraAudioFrame farInFrame = new AgoraAudioFrame();\n        farInFrame.setType(Constants.AudioFrameType.PCM16.getValue());\n        farInFrame.setSampleRate(sampleRate);\n        farInFrame.setChannels(channels);\n        farInFrame.setSamplesPerChannel(samplesPerChannel);\n        farInFrame.setBytesPerSample(bytesPerSample);\n        // In a real application, pcmDataFar would come from a far-end audio source\n        byte[] pcmDataFar = new byte[bufferSize]; \n        // ... Fill pcmDataFar with dummy data here ...\n        ByteBuffer farAudioBuffer = ByteBuffer.allocateDirect(bufferSize);\n        farAudioBuffer.put(pcmDataFar);\n        farAudioBuffer.flip();\n        farInFrame.setBuffer(farAudioBuffer);\n\n        // 5. Process the audio frame\n        // If you only need to process the near-end audio (e.g., only ANS, AGC), \n        // you can call the single-parameter process method:\n        // AgoraAudioFrame outputFrame = audioProcessor.process(nearInFrame);\n\n        // If AEC processing is required, pass both near-end and far-end audio frames\n        AgoraAudioFrame outputFrame = audioProcessor.process(nearInFrame, farInFrame);\n\n        if (outputFrame != null \u0026\u0026 outputFrame.getBuffer() != null) {\n            System.out.println(\"Audio frame processed successfully.\");\n            ByteBuffer processedBuffer = outputFrame.getBuffer();\n            // processedBuffer contains the 3A + BGHVS-processed audio data\n            // The processed audio will have the following optimizations:\n            // - AEC: Acoustic echo cancellation\n            // - ANS: Background noise suppression\n            // - AGC: Automatic gain control\n            // - BGHVS: Background human voice suppression\n            // You can write this data to a file, send it over the network, or perform other operations\n            // Example: Get processed byte data:\n            // byte[] processedBytes = new byte[processedBuffer.remaining()];\n            // processedBuffer.get(processedBytes);\n            // System.out.println(\"Processed data sample (first 10 bytes): \" +\n            // Arrays.toString(Arrays.copyOfRange(processedBytes, 0, Math.min(10, processedBytes.length))));\n        } else {\n            System.err.println(\"Failed to process audio frame or output frame is null.\");\n            // Check for error callbacks or the return value of the process method\n        }\n\n        // 6. Release resources\n        int releaseRet = audioProcessor.release();\n        if (releaseRet == 0) {\n            System.out.println(\"AgoraAudioProcessor released successfully.\");\n        } else {\n            System.err.println(\"Failed to release AgoraAudioProcessor. Error code: \" + releaseRet);\n        }\n    }\n}\n```\n\n## Changelog\n\n### v4.4.32.101 (2025-09-01)\n\n- **API Changes**\n  - **AudioFrame**: Added `presentationMs` field and getter/setter to carry audio frame PTS (ms).\n  - **EncodedVideoFrameInfo**: Added `presentationMs` field and constructor parameter; can be used to pass video frame PTS (ms).\n  - **EncodedAudioFrameInfo**: Added `captureTimeMs` field and constructor parameter; records capture timestamp (ms).\n  - **AgoraRtcConn**: Added overload `pushAudioPcmData(byte[] data, int sampleRate, int channels, long presentationMs)`; the original `pushAudioPcmData(byte[] data, int sampleRate, int channels)` remains (equivalent to `presentationMs=0`).\n\n- **Improvements \u0026 Optimizations**\n  - Fixed a potential exception in `IAudioFrameObserver` callback under extreme scenarios, improving stability.\n\n### v4.4.32.100（2025-07-22）\n\n- This version supports AIQoS, and the API has changed, please refer to [AIQoS Upgrade Guide](AIQoS_Upgrade_Guide.md)\n\n### v4.4.32.1 (2025-06-12)\n\n#### **API Changes**\n\n- Optimized the `onStreamMessage` callback parameters in the `ILocalUserObserver` interface. The original method `onStreamMessage(AgoraLocalUser agoraLocalUser, String userId, int streamId, String data, long length)` has been changed to `onStreamMessage(AgoraLocalUser agoraLocalUser, String userId, int streamId, byte[] data)` to improve flexibility and efficiency in message handling.\n\n#### **Improvements \u0026 Optimizations**\n\n- Fixed an issue in the `setLogFileSize` method of `AgoraServiceConfig` where the unit was incorrectly applied as bytes when set in KB. The log file size is now correctly set in KB.\n\n### v4.4.32 (2025-05-27)\n\n#### **API Changes**\n\n- `AgoraService`: Added `getSdkVersion` method to obtain the SDK version.\n- `AgoraAudioEncodedFrameSender`: Removed `send(byte[] payloadData, int payloadSize, EncodedAudioFrameInfo info)` method, replaced with `sendEncodedAudioFrame(byte[] payloadData, EncodedAudioFrameInfo info)`.\n- `AgoraAudioPcmDataSender`: The method `send(byte[] audioData, int captureTimestamp, int samplesPerChannel, int bytesPerSample, int numberOfChannels, int sampleRate)` is now deprecated, replaced with `sendAudioPcmData(AudioFrame audioFrame)`.\n- `AgoraVideoEncodedImageSender`: Removed `send(byte[] imageBuffer, int length, EncodedVideoFrameInfo info)` method, replaced with `sendEncodedVideoImage(byte[] imageBuffer, EncodedVideoFrameInfo info)`.\n- `AgoraVideoFrameSender`: Removed `send(ExternalVideoFrame frame)` method, replaced with `sendVideoFrame(ExternalVideoFrame frame)`.\n\n#### **Improvements \u0026 Optimizations**\n\n- Fixed a potential crash issue caused by the `destroy` method.\n\n### v4.4.31.4 (2025-03-21)\n\n#### **Improvements \u0026 Optimizations**\n\n- Fixed potential crashes caused by exceptions in multi-threaded environments.\n- Improved error handling processes, enhancing recovery capabilities in exceptional circumstances.\n\n### v4.4.31.3 (2025-02-26)\n\n#### **Improvements \u0026 Optimizations**\n\n- Fixed exception handling issues potentially caused by memory reuse.\n\n### v4.4.31.2 (2025-02-19)\n\n#### **API Changes**\n\n- Added `sendStreamMessage(int streamId, byte[] messageData)` method, deprecated `sendStreamMessage(int streamId, String message, int length)` method.\n\n#### **Improvements \u0026 Optimizations**\n\n- Optimized code handling, improving system robustness.\n\n### v4.4.31.1 (2025-01-06)\n\n#### **Improvements \u0026 Optimizations**\n\n- Optimized VAD function configuration; VAD is now enabled by default, manual configuration is not required.\n\n### v4.4.31 (2024-12-23)\n\n#### **API Changes**\n\n- Added `DomainLimit` configuration option in `AgoraServiceConfig` for domain limit management.\n- Added `VadDumpUtils` utility class, supporting export of debug data from the VAD process.\n- Added `AudioConsumerUtils` class, providing an optimized PCM data transmission mechanism.\n- Modified `registerAudioFrameObserver` method in `AgoraLocalUser` to support configuration of `AgoraAudioVadConfigV2` parameters.\n- Added `vadResult` parameter to the `onPlaybackAudioFrameBeforeMixing` callback in `IAudioFrameObserver`.\n- Added `sendAudioMetaData` method in `AgoraLocalUser` class to support sending audio metadata.\n- Added `onAudioMetaDataReceived` callback in `ILocalUserObserver` class for receiving audio metadata.\n- Added `ColorSpace` property in `ExternalVideoFrame` class to support custom color space settings.\n\n#### **Improvements \u0026 Optimizations**\n\n- Optimized code logic architecture, significantly improving memory usage efficiency.\n- Fixed multiple memory leak issues, enhancing system stability.\n- Strengthened memory access security mechanisms, effectively preventing memory corruption issues.\n\n### v4.4.30.2 (2024-11-20)\n\n#### **API Changes**\n\n- Enhanced `processFrame` handling in AgoraAudioVadV2, adding `START_SPEAKING` and `STOP_SPEAKING` state callbacks.\n- Improved parameter types for encoded frame callbacks: `onEncodedAudioFrameReceived`, `onEncodedVideoImageReceived`, `onEncodedVideoFrame` now use `ByteBuffer` instead of `Byte` arrays.\n\n#### **Improvements \u0026 Optimizations**\n\n- VAD plugin startup optimization: `enableExtension` is now handled internally by the SDK; applications no longer need to call this method manually.\n- Fixed handling issues with `alphaBuffer` and `metadataBuffer` in `VideoFrame`.\n\n### v4.4.30.1 (2024-11-12)\n\n#### **API Changes**\n\n- Added AgoraAudioVad2 related `Vad2` interface, removed AgoraAudioVad related `Vad` interface.\n- Added callback interface `IAudioEncodedFrameObserver` for receiving encoded audio.\n\n#### **Improvements \u0026 Optimizations**\n\n- Fixed crash issues related to `LocalAudioDetailedStats` callbacks.\n- Modified parameter types for the `onAudioVolumeIndication` callback.\n\n### v4.4.30 (2024-10-24)\n\n- For detailed changelog, please refer to the [Release Notes](https://docs.agora.io/en/rtc-server-sdk/java/overview/release-notes/)\n\n## Other References\n\nRefer to the official website for details (\u003chttps://docs.agora.io/en/rtc-server-sdk/java/landing-page/\u003e)\n\nOfficial API documentation [Agora Server Java SDK API Reference](https://docs.agora.io/en/rtc-server-sdk/java/reference/api-overview/)\n\n\n#### **Improvements \u0026 Optimizations**\n\n- Fixed exception handling issues potentially caused by memory reuse.\n\n### v4.4.31.2 (2025-02-19)\n\n#### **API Changes**\n\n- Added `sendStreamMessage(int streamId, byte[] messageData)` method, deprecated `sendStreamMessage(int streamId, String message, int length)` method.\n\n#### **Improvements \u0026 Optimizations**\n\n- Optimized code handling, improving system robustness.\n\n### v4.4.31.1 (2025-01-06)\n\n#### **Improvements \u0026 Optimizations**\n\n- Optimized VAD function configuration; VAD is now enabled by default, manual configuration is not required.\n\n### v4.4.31 (2024-12-23)\n\n#### **API Changes**\n\n- Added `DomainLimit` configuration option in `AgoraServiceConfig` for domain limit management.\n- Added `VadDumpUtils` utility class, supporting export of debug data from the VAD process.\n- Added `AudioConsumerUtils` class, providing an optimized PCM data transmission mechanism.\n- Modified `registerAudioFrameObserver` method in `AgoraLocalUser` to support configuration of `AgoraAudioVadConfigV2` parameters.\n- Added `vadResult` parameter to the `onPlaybackAudioFrameBeforeMixing` callback in `IAudioFrameObserver`.\n- Added `sendAudioMetaData` method in `AgoraLocalUser` class to support sending audio metadata.\n- Added `onAudioMetaDataReceived` callback in `ILocalUserObserver` class for receiving audio metadata.\n- Added `ColorSpace` property in `ExternalVideoFrame` class to support custom color space settings.\n\n#### **Improvements \u0026 Optimizations**\n\n- Optimized code logic architecture, significantly improving memory usage efficiency.\n- Fixed multiple memory leak issues, enhancing system stability.\n- Strengthened memory access security mechanisms, effectively preventing memory corruption issues.\n\n### v4.4.30.2 (2024-11-20)\n\n#### **API Changes**\n\n- Enhanced `processFrame` handling in AgoraAudioVadV2, adding `START_SPEAKING` and `STOP_SPEAKING` state callbacks.\n- Improved parameter types for encoded frame callbacks: `onEncodedAudioFrameReceived`, `onEncodedVideoImageReceived`, `onEncodedVideoFrame` now use `ByteBuffer` instead of `Byte` arrays.\n\n#### **Improvements \u0026 Optimizations**\n\n- VAD plugin startup optimization: `enableExtension` is now handled internally by the SDK; applications no longer need to call this method manually.\n- Fixed handling issues with `alphaBuffer` and `metadataBuffer` in `VideoFrame`.\n\n### v4.4.30.1 (2024-11-12)\n\n#### **API Changes**\n\n- Added AgoraAudioVad2 related `Vad2` interface, removed AgoraAudioVad related `Vad` interface.\n- Added callback interface `IAudioEncodedFrameObserver` for receiving encoded audio.\n\n#### **Improvements \u0026 Optimizations**\n\n- Fixed crash issues related to `LocalAudioDetailedStats` callbacks.\n- Modified parameter types for the `onAudioVolumeIndication` callback.\n\n### v4.4.30 (2024-10-24)\n\n- For detailed changelog, please refer to the [Release Notes](https://docs.agora.io/en/rtc-server-sdk/java/overview/release-notes/)\n\n## Other References\n\nRefer to the official website for details (\u003chttps://docs.agora.io/en/rtc-server-sdk/java/landing-page/\u003e)\n\nOfficial API documentation [Agora Server Java SDK API Reference](https://docs.agora.io/en/rtc-server-sdk/java/reference/api-overview/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagoraio-extensions%2Fagora-java-server-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagoraio-extensions%2Fagora-java-server-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagoraio-extensions%2Fagora-java-server-sdk/lists"}