-
Notifications
You must be signed in to change notification settings - Fork 571
TechNote_Effects
Robert Wu edited this page Feb 24, 2023
·
1 revision
The Android Audio framework provides some effects processing that can be used by apps. It is available through the Java or Kotlin AudioEffect API
Another alternative is to do your own effects processing in your own app.
- Functions are provided for you so they are easy to use.
- They will work on all versions of Android. The AudioEffects can only be used with Oboe on Android 9 (Pie) and above. They are not supported for OpenSL ES.
- You can customize the effects as needed.
- You can get lower latency when you use your own effects. Using Android AudioEffects prevents you from getting a low latency path.
Oboe streams on Android 9 (Pie) and above can use the Java/Kotlin. See AudioEffect API
The basic idea is to use Java or Kotlin to create a Session with Effects. Then associate your Oboe streams with the session by creating them with a SessionID.
In Java:
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
int audioSessionId = audioManager.generateAudioSessionId();
Pass the audioSessionId to your C++ code using JNI. Then use it when opening your Oboe streams:
builder->setSessionId((oboe::SessionId) audioSessionId);
Note that these streams will probably not have low latency. So you may want to do your own effects processing.
There are many options for finding audio effects.
- Apps Using Oboe or AAudio
- Tech Notes
- OboeTester Instructions
- Quirks and Bugs
- Developer Notes