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 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 | 1139 |
1140 // We want to process at the lowest rate possible without losing information. | 1140 // We want to process at the lowest rate possible without losing information. |
1141 // Choose the lowest native rate at least equal to the input and codec rates. | 1141 // Choose the lowest native rate at least equal to the input and codec rates. |
1142 const int min_processing_rate = std::min(sample_rate_hz, codec_rate); | 1142 const int min_processing_rate = std::min(sample_rate_hz, codec_rate); |
1143 for (size_t i = 0; i < AudioProcessing::kNumNativeSampleRates; ++i) { | 1143 for (size_t i = 0; i < AudioProcessing::kNumNativeSampleRates; ++i) { |
1144 _audioFrame.sample_rate_hz_ = AudioProcessing::kNativeSampleRatesHz[i]; | 1144 _audioFrame.sample_rate_hz_ = AudioProcessing::kNativeSampleRatesHz[i]; |
1145 if (_audioFrame.sample_rate_hz_ >= min_processing_rate) { | 1145 if (_audioFrame.sample_rate_hz_ >= min_processing_rate) { |
1146 break; | 1146 break; |
1147 } | 1147 } |
1148 } | 1148 } |
1149 if (audioproc_->echo_control_mobile()->is_enabled()) { | |
1150 // AECM only supports 8 and 16 kHz. | |
1151 _audioFrame.sample_rate_hz_ = std::min( | |
1152 _audioFrame.sample_rate_hz_, AudioProcessing::kMaxAECMSampleRateHz); | |
1153 } | |
1154 _audioFrame.num_channels_ = std::min(num_channels, num_codec_channels); | 1149 _audioFrame.num_channels_ = std::min(num_channels, num_codec_channels); |
1155 RemixAndResample(audio, samples_per_channel, num_channels, sample_rate_hz, | 1150 RemixAndResample(audio, samples_per_channel, num_channels, sample_rate_hz, |
1156 &resampler_, &_audioFrame); | 1151 &resampler_, &_audioFrame); |
1157 } | 1152 } |
1158 | 1153 |
1159 int32_t TransmitMixer::RecordAudioToFile( | 1154 int32_t TransmitMixer::RecordAudioToFile( |
1160 uint32_t mixingFrequency) | 1155 uint32_t mixingFrequency) |
1161 { | 1156 { |
1162 rtc::CritScope cs(&_critSect); | 1157 rtc::CritScope cs(&_critSect); |
1163 if (_fileRecorderPtr == NULL) | 1158 if (_fileRecorderPtr == NULL) |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1330 void TransmitMixer::EnableStereoChannelSwapping(bool enable) { | 1325 void TransmitMixer::EnableStereoChannelSwapping(bool enable) { |
1331 swap_stereo_channels_ = enable; | 1326 swap_stereo_channels_ = enable; |
1332 } | 1327 } |
1333 | 1328 |
1334 bool TransmitMixer::IsStereoChannelSwappingEnabled() { | 1329 bool TransmitMixer::IsStereoChannelSwappingEnabled() { |
1335 return swap_stereo_channels_; | 1330 return swap_stereo_channels_; |
1336 } | 1331 } |
1337 | 1332 |
1338 } // namespace voe | 1333 } // namespace voe |
1339 } // namespace webrtc | 1334 } // namespace webrtc |
OLD | NEW |