summaryrefslogtreecommitdiffstats
path: root/media/audio/fake_audio_input_stream.cc
diff options
context:
space:
mode:
authorhenrika@chromium.org <henrika@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-28 12:40:02 +0000
committerhenrika@chromium.org <henrika@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-28 12:40:02 +0000
commitdd414bf1a20b69891729b94b3d76ac714d475a81 (patch)
tree1d706835f6628100e23b86b4c9c0677a4bd46b74 /media/audio/fake_audio_input_stream.cc
parentfb82b78d9beeee9dfb947ddf86b34ef038bdd013 (diff)
downloadchromium_src-dd414bf1a20b69891729b94b3d76ac714d475a81.zip
chromium_src-dd414bf1a20b69891729b94b3d76ac714d475a81.tar.gz
chromium_src-dd414bf1a20b69891729b94b3d76ac714d475a81.tar.bz2
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
Diffstat (limited to 'media/audio/fake_audio_input_stream.cc')
-rw-r--r--media/audio/fake_audio_input_stream.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/media/audio/fake_audio_input_stream.cc b/media/audio/fake_audio_input_stream.cc
index 0e4bb61..d5ba994 100644
--- a/media/audio/fake_audio_input_stream.cc
+++ b/media/audio/fake_audio_input_stream.cc
@@ -48,7 +48,7 @@ void FakeAudioInputStream::Start(AudioInputCallback* callback) {
void FakeAudioInputStream::DoCallback() {
DCHECK(callback_);
- callback_->OnData(this, buffer_.get(), buffer_size_, buffer_size_);
+ callback_->OnData(this, buffer_.get(), buffer_size_, buffer_size_, 0.0);
Time now = Time::Now();
base::TimeDelta next_callback_time =
@@ -87,3 +87,9 @@ void FakeAudioInputStream::SetVolume(double volume) {}
double FakeAudioInputStream::GetVolume() {
return 0.0;
}
+
+void FakeAudioInputStream::SetAutomaticGainControl(bool enabled) {}
+
+bool FakeAudioInputStream::GetAutomaticGainControl() {
+ return false;
+}