Note. The Android version below is 4.1 (JellyBean)
The answer is probably too late. However, for anyone interested in dbaustista strong> answers , consider the following:
AEC is modeled by the AudioEffect class. Thus, the AEC AudioEffect object must be added to the “chain of effects” RecordThread. I believe that the AEC implementation is built into the libaudioprocessing library. See Additional Notes below.
Library
/system/etc/audio_effects.conf libraries { ... pre_processing { path /system/lib/soundfx/libaudiopreprocessing.so } }
Interface
media/AudioEffect.h
Example
The following example shows how to add an AudioEffect object to PlaybackThread . Apply the same logic to RecordThread, i.e. add an AEC object to the RecordThread effects chain.
mediaframeworktest / functional / audio / MediaAudioEffectTest.java
AudioTrack track = new AudioTrack( AudioManager.STREAM_MUSIC, 44100, AudioFormat.CHANNEL_OUT_MONO, AudioFormat.ENCODING_PCM_16BIT, AudioTrack.getMinBufferSize(44100, AudioFormat.CHANNEL_OUT_MONO, AudioFormat.ENCODING_PCM_16BIT), AudioTrack.MODE_STREAM); assertNotNull(msg + ": could not create AudioTrack", track); AudioEffect effect = new AudioEffect(AudioEffect.EFFECT_TYPE_ENV_REVERB, AudioEffect.EFFECT_TYPE_NULL, 0, 0); track.attachAuxEffect(effect.getId()); track.setAuxEffectSendLevel(1.0f);
AEC configuration options
TODO: Add Sample AEC Configuration
source share