1[Tech Notes Home](README.md)
2
3# Using Audio Effects with Oboe
4
5## Overview
6
7The Android Audio framework provides some effects processing that can be used by apps.
8It is available through the Java or Kotlin
9[AudioEffect API](https://developer.android.com/reference/android/media/audiofx/AudioEffect)
10
11Another alternative is to do your own effects processing in your own app.
12
13### Reasons to use the Android AudioEffect in the OS:
141. Functions are provided for you so they are easy to use.
15
16### Reasons to do your own effects Processing:
171. 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.
182. You can customize the effects as needed.
193. You can get lower latency when you use your own effects. Using Android AudioEffects prevents you from getting a low latency path.
20
21## Using Android AudioEffects
22
23Oboe streams on Android 9 (Pie) and above can use the Java/Kotlin.
24See [AudioEffect API](https://developer.android.com/reference/android/media/audiofx/AudioEffect)
25
26The basic idea is to use Java or Kotlin to create a Session with Effects.
27Then associate your Oboe streams with the session by creating them with a SessionID.
28
29In Java:
30
31    AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
32    int audioSessionId = audioManager.generateAudioSessionId();
33
34Pass the audioSessionId to your C++ code using JNI. Then use it when opening your Oboe streams:
35
36    builder->setSessionId(sessionId);
37
38Note that these streams will probably not have low latency. So you may want to do your own effects processing.
39
40## Using Third Party Affects Processing
41
42There are many options for finding audio effects.
43
44- [Music DSP Archive](http://www.musicdsp.org/en/latest/Effects/index.html)
45- [Synthesis Toolkit in C++ (STK)](https://ccrma.stanford.edu/software/stk/index.html)
46- [Cookbook for Biquad Filters, EQ, etc.](https://www.w3.org/2011/audio/audio-eq-cookbook.html)
47- [Faust - language for generating effects, big library](https://faust.grame.fr/index.html)
48- [DAFX Digital Audio Effects conference proceedings](http://dafx.de/)
49