I want to apply equalizer changes to all apps. However, the use of 0 as a global session id was deprecated, you have to use:
mEqualizer = new Equalizer(0, mPlayer.getAudioSessionId());
mEqualizer = new Equalizer(0, 0);
According to Android, you can use ACTION_OPEN_AUDIO_EFFECT_CONTROL_SESSION to receive the id of a playing audio session:
Intent to signal to the effect control application or service that a new audio session is opened and requires audio effects to be applied.
However, how are you supposed to use it? I tried adding the constant in the manifest, but it didn’t work:
<receiver android:name=".receivers.AudioSessionReceiver"> <intent-filter> <action android:name="android.media.action.OPEN_AUDIO_EFFECT_CONTROL_SESSION"/> </intent-filter> </receiver>
(when I play an audio file, or a music video, the receiver isn’t called)
If this is not the way to apply audio (equalizer) settings to other apps, what is?
Update: I simply had issues with the Logcat, now it works, but only with Spotify and not other apps.