diff options
| author | 2011-01-06 01:56:27 -0800 | |
|---|---|---|
| committer | 2011-01-06 01:56:27 -0800 | |
| commit | f1304572aeb673f6ebf33c3b723aff74ab4b366e (patch) | |
| tree | 0d2525fcd089030b70ce0681eef571c4c0a9765e | |
| parent | 57d22a7430711368c9b6e8bf57a10881fee0440a (diff) | |
| parent | d87be273aaea32995c87a6cbc6250cbfeeddd84d (diff) | |
Merge "Enable built-in echo canceler if available."
| -rw-r--r-- | voip/jni/rtp/AudioGroup.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/voip/jni/rtp/AudioGroup.cpp b/voip/jni/rtp/AudioGroup.cpp index 64db250416b2..c031eeed96bb 100644 --- a/voip/jni/rtp/AudioGroup.cpp +++ b/voip/jni/rtp/AudioGroup.cpp @@ -484,7 +484,7 @@ private: ON_HOLD = 0, MUTED = 1, NORMAL = 2, - EC_ENABLED = 3, + ECHO_SUPPRESSION = 3, LAST_MODE = 3, }; @@ -619,6 +619,10 @@ bool AudioGroup::setMode(int mode) if (mode < 0 || mode > LAST_MODE) { return false; } + if (mode == ECHO_SUPPRESSION && AudioSystem::getParameters( + 0, String8("ec_supported")) == "ec_supported=yes") { + mode = NORMAL; + } if (mMode == mode) { return true; } @@ -775,8 +779,8 @@ bool AudioGroup::DeviceThread::threadLoop() AudioTrack track; AudioRecord record; if (track.set(AudioSystem::VOICE_CALL, sampleRate, AudioSystem::PCM_16_BIT, - AudioSystem::CHANNEL_OUT_MONO, output) != NO_ERROR || - record.set(AUDIO_SOURCE_MIC, sampleRate, AudioSystem::PCM_16_BIT, + AudioSystem::CHANNEL_OUT_MONO, output) != NO_ERROR || record.set( + AUDIO_SOURCE_VOICE_COMMUNICATION, sampleRate, AudioSystem::PCM_16_BIT, AudioSystem::CHANNEL_IN_MONO, input) != NO_ERROR) { LOGE("cannot initialize audio device"); return false; |