Android Question how to use audio effect framework, is here a audio effect lib?

hears

Active Member
Licensed User
Longtime User
in android 11, google add a audio effect feature, how to use it in b4a?





audio streams using the newly added effect library. Using audio effect framework, audio processing can be done either by using different android effect libraries or offloading audio streams to a third-party library.

This document explains ways of effect integration and how we can integrate effects into android.

New Audio Effect Integration​

Here, we are discussing how a new android effect can be integrated into the existing android framework. Android effect integration can be done in two steps:

1. Implementing a new effect library and integrating it into android effect framework

2. Integrate with JNI and Java Implementations to connect the applications with native systems

We will be concentrating here on the effect integration in android native side.

Effect Flow from Upper Java Layer to Native Effect Library​

Flow of effect handle creation from upper layer can be listed as follows:

1. From application code: MainActivity.java, Object of audio effects need to be created that invoke constructor of particular effect’s derived class.

2. From constructor of derived class, constructor of base class from AudioEffect.java will get called.

3. AudioEffect.java will take the flow to native framework through JNI layer: android_media_AudioEffect.cpp

4. Then the call reaches AndroidEffect.cpp ‘s set API. This is the entry point to native effect framework.

5. AudioEffect.cpp communicates to AudioFlinger.cpp

6. Audioflinger service will be calling create_effect_l of Threads.cpp implementation

7. Then EffectCreate of Effects.cpp will get called

8. From Effects.cpp, flow goes to EffectCreate of EffectFactory.cpp

9. Particular effect details - sampleEffect will be loaded from configuration files and particular effect handler will get created

Picture1-2-1-1.png

Figure 1: Effect Flow Diagram

New Effect Implementation – Native Layer​

 
Top