How to use LoudnessEnhancer audio effect with OpenSLES ?

183 views
Skip to first unread message

Naaman Sittsamer

unread,
Mar 23, 2015, 6:28:44 AM3/23/15
to andro...@googlegroups.com
Hi,
I want to use LoudnessEnhancer effect with VOIP call using Open-SLES.
From "effect_loudnessenhancer.h" it's clarified that this effect is not defined yet in the SLES library.

My question is if there's some other option to use it, instead of direct SLES API?
Since the effect is applied on audio session of MediaPlayer/AudioTrack, I would think that it could be used differently.

For example: 
Let's assume I have a method which gives the application (the APK who hosts OpenSLES logic) the audio session Id (it could be fetched by adding a code to AudioFlinger::getParameters).
Now we could use it in the standard way:

int sessionId = GetSessionId();
LoudnessEnhancer mLoudness = new LoudnessEnhancer(sessionId);
mLoudness.setEnabled(true);
mLoudness.setTargetGain(someTargetGain);

With this approach I see the effect is working but does nothing.
I see that "leftSample"/"rightSample" in "LE_process" (in EffectLoudnessEnhancer.cpp) are zero.

Do you have an idea how to make it working?


Thanks.
Naaman

Glenn Kasten

unread,
Mar 24, 2015, 5:30:08 PM3/24/15
to andro...@googlegroups.com
If you're asking about how to do it from a portable app, no there is no way to get access to that portably.
Can you please file a suggestion here:
   https://code.google.com/p/android/issues/list
If you are building the platform from source, you could modify the platform specifically for your need.

Naaman Sittsamer

unread,
Mar 25, 2015, 2:39:25 AM3/25/15
to andro...@googlegroups.com
Yes, I did make some changes to platform source, so now I can use the DRC module (libldnhncr) direct from audio HAL.
Thanks anyway.

Naaman
Reply all
Reply to author
Forward
0 new messages