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 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 | 1118 |
1119 // We want to process at the lowest rate possible without losing information. | 1119 // We want to process at the lowest rate possible without losing information. |
1120 // Choose the lowest native rate at least equal to the input and codec rates. | 1120 // Choose the lowest native rate at least equal to the input and codec rates. |
1121 const int min_processing_rate = std::min(sample_rate_hz, codec_rate); | 1121 const int min_processing_rate = std::min(sample_rate_hz, codec_rate); |
1122 for (size_t i = 0; i < AudioProcessing::kNumNativeSampleRates; ++i) { | 1122 for (size_t i = 0; i < AudioProcessing::kNumNativeSampleRates; ++i) { |
1123 _audioFrame.sample_rate_hz_ = AudioProcessing::kNativeSampleRatesHz[i]; | 1123 _audioFrame.sample_rate_hz_ = AudioProcessing::kNativeSampleRatesHz[i]; |
1124 if (_audioFrame.sample_rate_hz_ >= min_processing_rate) { | 1124 if (_audioFrame.sample_rate_hz_ >= min_processing_rate) { |
1125 break; | 1125 break; |
1126 } | 1126 } |
1127 } | 1127 } |
1128 if (audioproc_->echo_control_mobile()->is_enabled()) { | |
1129 // AECM only supports 8 and 16 kHz. | |
1130 _audioFrame.sample_rate_hz_ = std::min( | |
1131 _audioFrame.sample_rate_hz_, AudioProcessing::kMaxAECMSampleRateHz); | |
1132 } | |
1133 _audioFrame.num_channels_ = std::min(num_channels, num_codec_channels); | 1128 _audioFrame.num_channels_ = std::min(num_channels, num_codec_channels); |
1134 RemixAndResample(audio, samples_per_channel, num_channels, sample_rate_hz, | 1129 RemixAndResample(audio, samples_per_channel, num_channels, sample_rate_hz, |
1135 &resampler_, &_audioFrame); | 1130 &resampler_, &_audioFrame); |
1136 } | 1131 } |
1137 | 1132 |
1138 int32_t TransmitMixer::RecordAudioToFile( | 1133 int32_t TransmitMixer::RecordAudioToFile( |
1139 uint32_t mixingFrequency) | 1134 uint32_t mixingFrequency) |
1140 { | 1135 { |
1141 rtc::CritScope cs(&_critSect); | 1136 rtc::CritScope cs(&_critSect); |
1142 if (_fileRecorderPtr == NULL) | 1137 if (_fileRecorderPtr == NULL) |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1309 void TransmitMixer::EnableStereoChannelSwapping(bool enable) { | 1304 void TransmitMixer::EnableStereoChannelSwapping(bool enable) { |
1310 swap_stereo_channels_ = enable; | 1305 swap_stereo_channels_ = enable; |
1311 } | 1306 } |
1312 | 1307 |
1313 bool TransmitMixer::IsStereoChannelSwappingEnabled() { | 1308 bool TransmitMixer::IsStereoChannelSwappingEnabled() { |
1314 return swap_stereo_channels_; | 1309 return swap_stereo_channels_; |
1315 } | 1310 } |
1316 | 1311 |
1317 } // namespace voe | 1312 } // namespace voe |
1318 } // namespace webrtc | 1313 } // namespace webrtc |
OLD | NEW |