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

Unified Diff: media/audio/audio_util.cc

Issue 6721015: Add WebKit API to retrieve the audio hardware sample-rate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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
« content/renderer/renderer_webkitclient_impl.cc ('K') | « media/audio/audio_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_util.cc
===================================================================
--- media/audio/audio_util.cc (revision 78925)
+++ media/audio/audio_util.cc (working copy)
@@ -11,6 +11,9 @@
#include "base/basictypes.h"
#include "base/logging.h"
#include "media/audio/audio_util.h"
+#if defined(OS_MACOSX)
+#include "media/audio/mac/audio_low_latency_output_mac.h"
+#endif
namespace media {
@@ -219,4 +222,16 @@
}
}
+double GetAudioHardwareSampleRate()
+{
scherkus (not reviewing) 2011/03/23 04:57:57 nit: chromium style has brackets go on the functio
+#if defined(OS_MACOSX)
+ // Hardware sample-rate on the Mac can be configured, so we must query.
scherkus (not reviewing) 2011/03/23 04:57:57 nit: two space indent
+ return AUAudioOutputStream::HardwareSampleRate();
+#else
+ // Hardware for Windows and Linux is nearly always 48KHz.
+ // TODO(crogers) : return correct value in rare non-48KHz cases.
scherkus (not reviewing) 2011/03/23 04:57:57 this isn't quite true... in fact chrome os was shi
+ return 48000.0;
+#endif
+}
+
} // namespace media
« content/renderer/renderer_webkitclient_impl.cc ('K') | « media/audio/audio_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698