Audio extension
Updated
Use the APIs provided by the Video SDK to build an audio extension.
The audio filters you create are easily integrated into apps to supply voice effects and noise cancellation.
Understand the tech
An audio filter accesses voice data when it is captured from the user's local device, modifies it, then plays the updated data to local and remote video channels.
A typical transmission pipeline consists of a chain of procedures, including capture, pre-processing, encoding, transmitting, decoding, post-processing, and playback. To modify the voice or video data in the transmission pipeline, audio extensions are inserted into either the pre-processing or post-processing stage.
Prerequisites
- Android Studio 4.1 or higher.
- Android SDK API Level 24 or higher.
- A mobile device that runs Android 4.1 or higher.
- A project to develop in.
Project setup
In order to integrate an extension into your project:
- Follow the SDK setup flow in Quickstart - integrate an extension.
- Prepare the Android project structure and Gradle dependencies required for the extension package.
You are now ready to develop your extension.
Create an audio extension
After encapsulating the filter into an extension, you need to register and package it into a .aar or .so file, and submit it together with a file that contains the extension name, vendor name, and filter name to Agora.
Package the extension
-
Register the extension.
Register the extension with the
REGISTER_AGORA_EXTENSION_PROVIDERmacro inAgoraExtensionProviderEntry.h. Use this macro at the entrance of the extension implementation. When the SDK loads the extension, this macro automatically registers it to the SDK. For example:REGISTER_AGORA_EXTENSION_PROVIDER(ByteDance, agora::extension::ExtensionProvider); -
Link the
libagora-rtc-sdk-jni.sofile.In
CMakeLists.txt, specify the path to save thelibagora-rtc-sdk-jni.sofile in the downloaded SDK package according to the following table:File Path 64-bit libagora-rtc-sdk-jni.soAgoraWithByteDanceAndroid/agora-bytedance/src/main/agoraLibs/arm64-v8a32-bit libagora-rtc-sdk-jni.soAgoraWithByteDanceAndroid/agora-bytedance/src/main/agoraLibs/arm64-v7a -
Provide extension information.
Create a
.javaor.mdfile to provide the following information:EXTENSION_NAME: The name of the target link library used inCMakeLists.txt. For example, for a.sofile namedlibagora-bytedance.so, theEXTENSION_NAMEshould beagora-bytedance.EXTENSION_VENDOR_NAME: The name of the extension provider, which is used for registering in theagora-bytedance.cppfile.EXTENSION_FILTER_NAME: The name of the filter, which is defined inExtensionProvider.h.
Test your implementation
Once you have developed your extension and API endpoints, the next step is to test whether they work properly.
- Run functional and performance tests.
Your test report must contain:
- Proof that the extension is enabled and loaded in the SDK normally.
- Verification that all key-value pairs in
setExtensionPropertywork properly. - Verification that all event callbacks of your extension work properly through
IMediaExtensionObserver. - Performance data such as average per-frame processing time, peak memory usage, and peak CPU/GPU usage.
- Run an extension listing test. Verify the extension listing in the Marketplace test environment, including activation, deactivation, and the linked documentation.
- Write the integration document for your extension. Follow Integration guide for your extension to prepare the public integration document.
- Apply for testing. Contact Agora and provide your extension package, extension listing assets, company name, public email, Provisioning API endpoints, Usage and Billing API endpoints, pricing model, support page URL, website URL, and implementation guide URL.
- Test your extension listing after Agora enables the test environment.
You are then ready to Publish your extension.
