How to inherit and enable (make effectual) current audioeffects (bassboost, equalizer, whatever) from an app playing audiostreams, assuming some other app is at disposal on the device for the manipulation of the native intonation algorithms.
The API documentation is not obvious on how to achieve this.
The following is not working, or is insufficient:
Equalizer equalizer = new Equalizer(0, mediaPlayer.getAudioSessionId());
equalizer.setEnabled(true);
mediaPlayer.prepare();
mediaPlayer.start();
I can answer myself. The obvious solution should have been something like:
I got it to work only the following cumbersome way. Do note that the solution is deprecated, but that the deprecated solution has not been replaced by an alternative API.
Finally, i.e. subsequently, call mediaPlayer.prepare() or mediaPlayer.prepareAsync, else the
equalizerSystem = new Equalizer(0,0)will not work.Also set in AndroidManifest:
To adopt recurring changes to eq settings, there is additionally a need to detect this via OnParameterChangeListener.