I have used this code in the past:
AudioManager am = (AudioManager) getSystemService(getContext().AUDIO_SERVICE);
am.setParameters("noise_suppression=off");
Which is roughly equivalent to:
NoiseSuppressor ns;
ns = NoiseSuppressor.create(sessionID);
But it applies the effect to all sessions. Is there any way to do the same with AcousticEchoCanceler
and AutomaticGainControl
effects?
The problem is that the audio session I'm trying to adjust the gain to, is created by some external process and I cannot determine the sessionID
, so it would be enough for me to apply the effect to all sessions if only it could be done in a way similar to am.setParameters("noise_suppression=off");
FYI, the audio is being recorded by a VoIP framework embedded in my app (Plivo) but there is no way to access the stream to apply the effects.