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

Unified Diff: media/audio/audio_util.cc

Issue 9221010: Adds support for 16kHz input sample rate and mono channel config. in WebRTC. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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 8989eb9c91cede98062fda2837639c39051b959c..6c298252cd95103c4145f1e781a1a39ef1500a9c 100644
--- a/media/audio/audio_util.cc
+++ b/media/audio/audio_util.cc
@@ -337,6 +337,22 @@ size_t GetAudioHardwareBufferSize() {
#endif
}
+size_t GetAudioInputHardwareChannels() {
+ enum channel_layout { MONO = 1, STEREO = 2 };
tommi (sloooow) - chröme 2012/01/17 12:01:08 nice
+#if defined(OS_MACOSX)
+ return MONO;
+#elif defined(OS_WIN)
+ if (!IsWASAPISupported()) {
+ // Fall back to Windows Wave implementation on Windows XP or lower and
+ // use stereo by default.
+ return STEREO;
+ }
+ return WASAPIAudioInputStream::HardwareChannels(eConsole);
+#else
+ return STEREO;
+#endif
+}
+
// When transferring data in the shared memory, first word is size of data
// in bytes. Actual data starts immediately after it.

Powered by Google App Engine
This is Rietveld 408576698