OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1088 public_submodules_->echo_cancellation->stream_drift_samples()); | 1088 public_submodules_->echo_cancellation->stream_drift_samples()); |
1089 msg->set_level(gain_control()->stream_analog_level()); | 1089 msg->set_level(gain_control()->stream_analog_level()); |
1090 msg->set_keypress(capture_.key_pressed); | 1090 msg->set_keypress(capture_.key_pressed); |
1091 } | 1091 } |
1092 #endif | 1092 #endif |
1093 | 1093 |
1094 MaybeUpdateHistograms(); | 1094 MaybeUpdateHistograms(); |
1095 | 1095 |
1096 AudioBuffer* capture_buffer = capture_.capture_audio.get(); // For brevity. | 1096 AudioBuffer* capture_buffer = capture_.capture_audio.get(); // For brevity. |
1097 | 1097 |
1098 rms_.Process(rtc::ArrayView<const int16_t>( | |
1099 capture_buffer->channels_const()[0], | |
1100 capture_nonlocked_.capture_processing_format.num_frames())); | |
1101 if (++rms_interval_counter_ >= 1000) { | |
1102 rms_interval_counter_ = 0; | |
1103 RMSLevel::Levels levels = rms_.AverageAndPeak(); | |
1104 RTC_HISTOGRAM_COUNTS("WebRTC.Audio.ApmCaptureInputLevelAverage", | |
1105 levels.average, 1, RMSLevel::kMinLevelDb, 100); | |
peah-webrtc
2016/11/29 09:02:27
Why having a minimum value of 0? For a signal of m
hlundin-webrtc
2016/11/29 11:02:39
The value we get is between 0 and 127, which corre
| |
1106 RTC_HISTOGRAM_COUNTS("WebRTC.Audio.ApmCaptureInputLevelPeak", levels.peak, | |
1107 1, RMSLevel::kMinLevelDb, 100); | |
peah-webrtc
2016/11/29 09:02:27
Why having a minimum value of 0? For a signal of m
hlundin-webrtc
2016/11/29 11:02:39
See above.
| |
1108 } | |
1109 | |
1098 if (constants_.use_experimental_agc && | 1110 if (constants_.use_experimental_agc && |
1099 public_submodules_->gain_control->is_enabled()) { | 1111 public_submodules_->gain_control->is_enabled()) { |
1100 private_submodules_->agc_manager->AnalyzePreProcess( | 1112 private_submodules_->agc_manager->AnalyzePreProcess( |
1101 capture_buffer->channels()[0], capture_buffer->num_channels(), | 1113 capture_buffer->channels()[0], capture_buffer->num_channels(), |
1102 capture_nonlocked_.capture_processing_format.num_frames()); | 1114 capture_nonlocked_.capture_processing_format.num_frames()); |
1103 } | 1115 } |
1104 | 1116 |
1105 if (submodule_states_.CaptureMultiBandSubModulesActive() && | 1117 if (submodule_states_.CaptureMultiBandSubModulesActive() && |
1106 SampleRateSupportsMultiBand( | 1118 SampleRateSupportsMultiBand( |
1107 capture_nonlocked_.capture_processing_format.sample_rate_hz())) { | 1119 capture_nonlocked_.capture_processing_format.sample_rate_hz())) { |
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1879 capture_processing_format(kSampleRate16kHz), | 1891 capture_processing_format(kSampleRate16kHz), |
1880 split_rate(kSampleRate16kHz) {} | 1892 split_rate(kSampleRate16kHz) {} |
1881 | 1893 |
1882 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default; | 1894 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default; |
1883 | 1895 |
1884 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default; | 1896 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default; |
1885 | 1897 |
1886 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default; | 1898 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default; |
1887 | 1899 |
1888 } // namespace webrtc | 1900 } // namespace webrtc |
OLD | NEW |