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

Unified Diff: Source/platform/audio/StereoPanner.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
Index: Source/platform/audio/StereoPanner.h
diff --git a/LICENSE b/Source/platform/audio/StereoPanner.h
similarity index 63%
copy from LICENSE
copy to Source/platform/audio/StereoPanner.h
index 70bcb8ad118978579fa055f7ecc99604930900ce..85a5f7b467294c150ddc8fcd0a5997c6d0d9d3e4 100644
--- a/LICENSE
+++ b/Source/platform/audio/StereoPanner.h
@@ -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,35 @@
// 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.
+
+#ifndef StereoPanner_h
+#define StereoPanner_h
+
+#include "platform/audio/Spatializer.h"
+
+namespace blink {
+
+// Common type of stereo panner as found in normal audio mixing equipment.
+class PLATFORM_EXPORT StereoPanner final : public Spatializer {
+public:
+ StereoPanner(float sampleRate);
+
+ virtual void panWithSampleAccurateValues(const AudioBus* inputBus, AudioBus* outputBuf, const float* panValues, size_t framesToProcess) override;
+ virtual void panToTargetValue(const AudioBus* inputBus, AudioBus* outputBuf, float panValue, size_t framesToProcess) override;
+
+ virtual void reset() override { }
+
+ virtual double tailTime() const override { return 0; }
+ virtual double latencyTime() const override { return 0; }
+
+private:
+ bool m_isFirstRender;
+ double m_smoothingConstant;
+
+ double m_gainL;
+ double m_gainR;
+};
+
+} // namespace blink
+
+#endif // StereoPanner_h

Powered by Google App Engine
This is Rietveld 408576698