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

Unified Diff: media/audio/audio_util.cc

Issue 9655023: Adding input and output audio backend to Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased && addressed qinmin's comments Created 8 years, 9 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/audio_util.cc
diff --git a/media/audio/audio_util.cc b/media/audio/audio_util.cc
index 3d227945df37375ba28adda5072b1f8da5daedf6..5f490af060f9a1fd151581516867a0baa27c88be 100644
--- a/media/audio/audio_util.cc
+++ b/media/audio/audio_util.cc
@@ -305,8 +305,8 @@ void MixStreams(void* dst,
int GetAudioHardwareSampleRate() {
#if defined(OS_MACOSX)
- // Hardware sample-rate on the Mac can be configured, so we must query.
- return AUAudioOutputStream::HardwareSampleRate();
+ // Hardware sample-rate on the Mac can be configured, so we must query.
+ return AUAudioOutputStream::HardwareSampleRate();
#elif defined(OS_WIN)
if (!IsWASAPISupported()) {
// Fall back to Windows Wave implementation on Windows XP or lower
@@ -318,6 +318,8 @@ int GetAudioHardwareSampleRate() {
// TODO(henrika): improve possibility to specify audio endpoint.
// Use the default device (same as for Wave) for now to be compatible.
return WASAPIAudioOutputStream::HardwareSampleRate(eConsole);
+#elif defined(OS_ANDROID)
+ return 16000;
#else
// Hardware for Linux is nearly always 48KHz.
// TODO(crogers) : return correct value in rare non-48KHz cases.
@@ -335,6 +337,8 @@ int GetAudioInputHardwareSampleRate(const std::string& device_id) {
return 48000;
}
return WASAPIAudioInputStream::HardwareSampleRate(device_id);
+#elif defined(OS_ANDROID)
+ return 16000;
#else
return 48000;
#endif

Powered by Google App Engine
This is Rietveld 408576698