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

Unified Diff: Source/platform/audio/Spatializer.cpp

Issue 691143007: Implement StereoPannerNode for robust stereo panning (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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: Source/platform/audio/Spatializer.cpp
diff --git a/LICENSE b/Source/platform/audio/Spatializer.cpp
similarity index 71%
copy from LICENSE
copy to Source/platform/audio/Spatializer.cpp
index 70bcb8ad118978579fa055f7ecc99604930900ce..fe7996fea6ba77b53ddd9700f0c6443f92027e48 100644
--- a/LICENSE
+++ b/Source/platform/audio/Spatializer.cpp
@@ -1,8 +1,5 @@
// Copyright 2014 The Chromium Authors. All rights reserved.
//
-// The Chromium Authors can be found at
-// http://src.chromium.org/svn/trunk/src/AUTHORS
-//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -28,3 +25,37 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "config.h"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "platform/audio/Spatializer.h"
+
+#include "platform/audio/StereoPanner.h"
+
+namespace blink {
+
+Spatializer* Spatializer::create(PanningModel model, float sampleRate)
+{
+ Spatializer* panner;
+
+ switch (model) {
+ case PanningModelEqualPower:
+ panner = new StereoPanner(sampleRate);
+ break;
+
+ // TODO: add the instantiation of BinauralPanner here.
+ // TODO: add the instantiation of SurroundPanner here.
+
+ default:
+ ASSERT_NOT_REACHED();
+ return nullptr;
+ }
+
+ return panner;
+}
+
+} // namespace blink
+
+#endif // ENABLE(WEB_AUDIO)

Powered by Google App Engine
This is Rietveld 408576698