From dd414bf1a20b69891729b94b3d76ac714d475a81 Mon Sep 17 00:00:00 2001
From: "henrika@chromium.org"
 <henrika@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Wed, 28 Mar 2012 12:40:02 +0000
Subject: Adds Analog Gain Control (AGC) to the WebRTC client.

The AGC functionality is as follows. It aims at maintaining the same speech loudness level from the microphone.
This is done by both controlling the analog microphone gain and applying a digital gain.

The microphone gain on the sound card is slowly increased/decreased during speech only. By observing the microphone control slider you can see it move when you speak. If you scream, the slider moves downwards and then upwards again when you return to normal.
It is not uncommon that the slider hits the maximum. This means that the maximum analog gain is not large enough to give the desired loudness. Nevertheless, we can in general still attain the desired loudness.

If the microphone control slider is moved manually, the analog adaptation restarts and returns to roughly the same position as before the change if the circumstances are still the same.

When the input microphone signal causes saturation, the level is decreased dramatically and has to re-adapt towards the old level.

The adaptation is a slowly varying process and at the beginning of a call this is noticed by a slow increase in volume.

Smaller changes in microphone input level is leveled out by the built-in digital control. For larger differences we need to rely on the slow adaptation.

BUG=115265
TEST=content_unittests

Review URL: https://chromiumcodereview.appspot.com/9702019

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129400 0039d316-1c4b-4281-b951-d872f2087c98
---
 content/renderer/pepper/pepper_platform_audio_input_impl.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'content/renderer/pepper/pepper_platform_audio_input_impl.cc')

diff --git a/content/renderer/pepper/pepper_platform_audio_input_impl.cc b/content/renderer/pepper/pepper_platform_audio_input_impl.cc
index f6c3244..6c42f75 100644
--- a/content/renderer/pepper/pepper_platform_audio_input_impl.cc
+++ b/content/renderer/pepper/pepper_platform_audio_input_impl.cc
@@ -127,7 +127,7 @@ void PepperPlatformAudioInputImpl::InitializeOnIOThread(int session_id) {
   if (!session_id) {
     // We will be notified by OnStreamCreated().
     filter_->Send(new AudioInputHostMsg_CreateStream(
-        stream_id_, params_, AudioManagerBase::kDefaultDeviceId));
+        stream_id_, params_, AudioManagerBase::kDefaultDeviceId, false));
   } else {
     // We will be notified by OnDeviceReady().
     filter_->Send(new AudioInputHostMsg_StartDevice(stream_id_, session_id));
@@ -229,7 +229,7 @@ void PepperPlatformAudioInputImpl::OnDeviceReady(const std::string& device_id) {
   } else {
     // We will be notified by OnStreamCreated().
     filter_->Send(new AudioInputHostMsg_CreateStream(stream_id_, params_,
-                                                     device_id));
+                                                     device_id, false));
   }
 }
 
-- 
cgit v1.1