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

Unified Diff: media/audio/android/audio_manager_android.cc

Issue 14049003: Set default sampling rate to 44100 and query the native output sampling rate. (Closed) Base URL: https://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: media/audio/android/audio_manager_android.cc
===================================================================
--- media/audio/android/audio_manager_android.cc (revision 194029)
+++ media/audio/android/audio_manager_android.cc (working copy)
@@ -47,14 +47,13 @@
AudioParameters AudioManagerAndroid::GetInputStreamParameters(
const std::string& device_id) {
- // TODO(xians): figure out the right input sample rate and buffer size to
- // achieve the best audio performance for Android devices.
- // TODO(xians): query the native channel layout for the specific device.
- static const int kDefaultSampleRate = 16000;
static const int kDefaultBufferSize = 1024;
return AudioParameters(
- AudioParameters::AUDIO_PCM_LOW_LATENCY, CHANNEL_LAYOUT_STEREO,
- kDefaultSampleRate, 16, kDefaultBufferSize);
+ AudioParameters::AUDIO_PCM_LOW_LATENCY,
+ CHANNEL_LAYOUT_STEREO,
+ GetNativeOutputSampleRatee(),
+ 16,
+ kDefaultBufferSize);
}
AudioOutputStream* AudioManagerAndroid::MakeLinearOutputStream(
@@ -85,11 +84,10 @@
const AudioParameters& input_params) {
// TODO(xians): figure out the right output sample rate and sample rate to
// achieve the best audio performance for Android devices.
- static const int kDefaultSampleRate = 16000;
static const int kDefaultBufferSize = 1024;
ChannelLayout channel_layout = CHANNEL_LAYOUT_STEREO;
- int sample_rate = kDefaultSampleRate;
+ int sample_rate = GetNativeOutputSampleRatee();
int buffer_size = kDefaultBufferSize;
int bits_per_sample = 16;
int input_channels = 0;

Powered by Google App Engine
This is Rietveld 408576698