Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: webrtc/voice_engine/transmit_mixer.cc

Issue 1338833002: Fix the maximum native sample rate in AudioProcessing (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix 44k1 sample rate Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1129 return _fileRecording; 1129 return _fileRecording;
1130 } 1130 }
1131 1131
1132 void TransmitMixer::GenerateAudioFrame(const int16_t* audio, 1132 void TransmitMixer::GenerateAudioFrame(const int16_t* audio,
1133 size_t samples_per_channel, 1133 size_t samples_per_channel,
1134 int num_channels, 1134 int num_channels,
1135 int sample_rate_hz) { 1135 int sample_rate_hz) {
1136 int codec_rate; 1136 int codec_rate;
1137 int num_codec_channels; 1137 int num_codec_channels;
1138 GetSendCodecInfo(&codec_rate, &num_codec_channels); 1138 GetSendCodecInfo(&codec_rate, &num_codec_channels);
1139 // TODO(ajm): This currently restricts the sample rate to 32 kHz.
1140 // See: https://code.google.com/p/webrtc/issues/detail?id=3146
1141 // When 48 kHz is supported natively by AudioProcessing, this will have
1142 // to be changed to handle 44.1 kHz.
1143 int max_sample_rate_hz = kAudioProcMaxNativeSampleRateHz; 1139 int max_sample_rate_hz = kAudioProcMaxNativeSampleRateHz;
1144 if (audioproc_->echo_control_mobile()->is_enabled()) { 1140 if (audioproc_->echo_control_mobile()->is_enabled()) {
1145 // AECM only supports 8 and 16 kHz. 1141 // AECM only supports 8 and 16 kHz.
1146 max_sample_rate_hz = 16000; 1142 max_sample_rate_hz = 16000;
1147 } 1143 }
1148 codec_rate = std::min(codec_rate, max_sample_rate_hz); 1144 codec_rate = std::min(codec_rate, max_sample_rate_hz);
1149 stereo_codec_ = num_codec_channels == 2; 1145 stereo_codec_ = num_codec_channels == 2;
1150 1146
1151 if (!mono_buffer_.get()) { 1147 if (!mono_buffer_.get()) {
1152 // Temporary space for DownConvertToCodecFormat. 1148 // Temporary space for DownConvertToCodecFormat.
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
1337 void TransmitMixer::EnableStereoChannelSwapping(bool enable) { 1333 void TransmitMixer::EnableStereoChannelSwapping(bool enable) {
1338 swap_stereo_channels_ = enable; 1334 swap_stereo_channels_ = enable;
1339 } 1335 }
1340 1336
1341 bool TransmitMixer::IsStereoChannelSwappingEnabled() { 1337 bool TransmitMixer::IsStereoChannelSwappingEnabled() {
1342 return swap_stereo_channels_; 1338 return swap_stereo_channels_;
1343 } 1339 }
1344 1340
1345 } // namespace voe 1341 } // namespace voe
1346 } // namespace webrtc 1342 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698