OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/audio/audio_input_controller.h" | 5 #include "media/audio/audio_input_controller.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
(...skipping 27 matching lines...) Expand all Loading... | |
38 // by 1-exp(-1/(fs*ts)), where fs is the sample rate in Hz and ts is the time | 38 // by 1-exp(-1/(fs*ts)), where fs is the sample rate in Hz and ts is the time |
39 // constant given by |kPowerMeasurementTimeConstantMilliseconds|. | 39 // constant given by |kPowerMeasurementTimeConstantMilliseconds|. |
40 // Example: fs=44100, ts=10e-3 => alpha~0.022420 | 40 // Example: fs=44100, ts=10e-3 => alpha~0.022420 |
41 // fs=44100, ts=20e-3 => alpha~0.165903 | 41 // fs=44100, ts=20e-3 => alpha~0.165903 |
42 // A large smoothing factor corresponds to a faster filter response to input | 42 // A large smoothing factor corresponds to a faster filter response to input |
43 // changes since y(n)=alpha*x(n)+(1-alpha)*y(n-1), where x(n) is the input | 43 // changes since y(n)=alpha*x(n)+(1-alpha)*y(n-1), where x(n) is the input |
44 // and y(n) is the output. | 44 // and y(n) is the output. |
45 const int kPowerMeasurementTimeConstantMilliseconds = 10; | 45 const int kPowerMeasurementTimeConstantMilliseconds = 10; |
46 | 46 |
47 // Time in seconds between two successive measurements of audio power levels. | 47 // Time in seconds between two successive measurements of audio power levels. |
48 const int kPowerMonitorLogIntervalSeconds = 5; | 48 const int kPowerMonitorLogIntervalSeconds = 15; |
Henrik Grunell
2014/09/08 10:57:24
Would it make sense to have 15 seconds to the firs
| |
49 #endif | 49 #endif |
50 } | 50 } |
51 | 51 |
52 // Used to log the result of capture startup. | 52 // Used to log the result of capture startup. |
53 // This was previously logged as a boolean with only the no callback and OK | 53 // This was previously logged as a boolean with only the no callback and OK |
54 // options. The enum order is kept to ensure backwards compatibility. | 54 // options. The enum order is kept to ensure backwards compatibility. |
55 // Elements in this enum should not be deleted or rearranged; the only | 55 // Elements in this enum should not be deleted or rearranged; the only |
56 // permitted operation is to add new elements before CAPTURE_STARTUP_RESULT_MAX | 56 // permitted operation is to add new elements before CAPTURE_STARTUP_RESULT_MAX |
57 // and update CAPTURE_STARTUP_RESULT_MAX. | 57 // and update CAPTURE_STARTUP_RESULT_MAX. |
58 enum CaptureStartupResult { | 58 enum CaptureStartupResult { |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
616 } | 616 } |
617 | 617 |
618 void AudioInputController::LogSilenceState(SilenceState value) { | 618 void AudioInputController::LogSilenceState(SilenceState value) { |
619 UMA_HISTOGRAM_ENUMERATION("Media.AudioInputControllerSessionSilenceReport", | 619 UMA_HISTOGRAM_ENUMERATION("Media.AudioInputControllerSessionSilenceReport", |
620 value, | 620 value, |
621 SILENCE_STATE_MAX + 1); | 621 SILENCE_STATE_MAX + 1); |
622 } | 622 } |
623 #endif | 623 #endif |
624 | 624 |
625 } // namespace media | 625 } // namespace media |
OLD | NEW |