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

Side by Side Diff: media/audio/audio_util.cc

Issue 12218036: Enable audio capture on Android (Closed) Base URL: https://src.chromium.org/svn/trunk/src/
Patch Set: solve unit test Created 7 years, 10 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Software adjust volume of samples, allows each audio stream its own 5 // Software adjust volume of samples, allows each audio stream its own
6 // volume without impacting master volume for chrome and other applications. 6 // volume without impacting master volume for chrome and other applications.
7 7
8 // Implemented as templates to allow 8, 16 and 32 bit implementations. 8 // Implemented as templates to allow 8, 16 and 32 bit implementations.
9 // 8 bit is unsigned and biased by 128. 9 // 8 bit is unsigned and biased by 128.
10 10
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 // (see GetAudioHardwareBufferSize()), which corresponds to an output 128 // (see GetAudioHardwareBufferSize()), which corresponds to an output
129 // delay of ~5.33ms. 129 // delay of ~5.33ms.
130 return 48000; 130 return 48000;
131 } 131 }
132 132
133 // Hardware sample-rate on Windows can be configured, so we must query. 133 // Hardware sample-rate on Windows can be configured, so we must query.
134 // TODO(henrika): improve possibility to specify an audio endpoint. 134 // TODO(henrika): improve possibility to specify an audio endpoint.
135 // Use the default device (same as for Wave) for now to be compatible. 135 // Use the default device (same as for Wave) for now to be compatible.
136 return WASAPIAudioOutputStream::HardwareSampleRate(); 136 return WASAPIAudioOutputStream::HardwareSampleRate();
137 #elif defined(OS_ANDROID) 137 #elif defined(OS_ANDROID)
138 // TODO(leozwang): return native sampling rate on Android.
138 return 16000; 139 return 16000;
139 #else 140 #else
140 // Hardware for Linux is nearly always 48KHz. 141 // Hardware for Linux is nearly always 48KHz.
141 // TODO(crogers) : return correct value in rare non-48KHz cases. 142 // TODO(crogers) : return correct value in rare non-48KHz cases.
142 return 48000; 143 return 48000;
143 #endif 144 #endif
144 } 145 }
145 146
146 int GetAudioInputHardwareSampleRate(const std::string& device_id) { 147 int GetAudioInputHardwareSampleRate(const std::string& device_id) {
147 // TODO(henrika): add support for device selection on all platforms. 148 // TODO(henrika): add support for device selection on all platforms.
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 // out performance was degraded compared to XP. 278 // out performance was degraded compared to XP.
278 // - The regression was fixed in Windows 7 and most configurations will work 279 // - The regression was fixed in Windows 7 and most configurations will work
279 // with 2, but some (e.g., some Sound Blasters) still need 3. 280 // with 2, but some (e.g., some Sound Blasters) still need 3.
280 // - Some XP configurations (even multi-processor ones) also need 3. 281 // - Some XP configurations (even multi-processor ones) also need 3.
281 return (base::win::GetVersion() == base::win::VERSION_VISTA) ? 4 : 3; 282 return (base::win::GetVersion() == base::win::VERSION_VISTA) ? 4 : 3;
282 } 283 }
283 284
284 #endif 285 #endif
285 286
286 } // namespace media 287 } // namespace media
OLDNEW
« media/audio/android/audio_manager_android.cc ('K') | « media/audio/android/audio_manager_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698