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

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

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
« no previous file with comments | « Source/modules/webaudio/StereoPannerNode.idl ('k') | Source/platform/audio/Spatializer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/audio/Spatializer.h
diff --git a/Source/platform/audio/Spatializer.h b/Source/platform/audio/Spatializer.h
new file mode 100644
index 0000000000000000000000000000000000000000..aaa6ca34ad0bec5905a4bc96d84f6e2a3cb05d35
--- /dev/null
+++ b/Source/platform/audio/Spatializer.h
@@ -0,0 +1,47 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef Spatializer_h
+#define Spatializer_h
+
+#include "platform/PlatformExport.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class AudioBus;
+
+// Abstract base class for spatializing a mono or stereo source.
+class PLATFORM_EXPORT Spatializer : public GarbageCollected<Spatializer> {
+public:
+ enum {
+ PanningModelEqualPower = 0
+
+ // We have a plan to add more panning models other than equal-power.
+ // (such as binaural-HRTF or N-channel surround panning)
+ };
+
+ typedef unsigned PanningModel;
+
+ static Spatializer* create(PanningModel, float sampleRate);
+
+ // Handle sample-accurate panning by AudioParam automation.
+ virtual void panWithSampleAccurateValues(const AudioBus* inputBus, AudioBus* outputBuf, const float* panValues, size_t framesToProcess) = 0;
+
+ // Handle de-zippered panning to a target value.
+ virtual void panToTargetValue(const AudioBus* inputBus, AudioBus* outputBuf, float panValue, size_t framesToProcess) = 0;
+
+ virtual void reset() = 0;
+ virtual double tailTime() const = 0;
+ virtual double latencyTime() const = 0;
+
+ virtual void trace(Visitor*) { }
+
+protected:
+ explicit Spatializer(PanningModel model) { }
+};
+
+} // namespace blink
+
+#endif // Spatializer_h
« no previous file with comments | « Source/modules/webaudio/StereoPannerNode.idl ('k') | Source/platform/audio/Spatializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698