Index: third_party/WebKit/Source/platform/audio/StereoPanner.cpp |
diff --git a/third_party/WebKit/Source/platform/audio/StereoPanner.cpp b/third_party/WebKit/Source/platform/audio/StereoPanner.cpp |
index bc636e286b0b1da790ddbd706a9991c04a829a3e..9e9708d70fe3f66ab2e3236a1108340098300d99 100644 |
--- a/third_party/WebKit/Source/platform/audio/StereoPanner.cpp |
+++ b/third_party/WebKit/Source/platform/audio/StereoPanner.cpp |
@@ -13,15 +13,16 @@ const float SmoothingTimeConstant = 0.050f; |
namespace blink { |
-// Implement equal-power panning algorithm for mono or stereo input. |
-// See: http://webaudio.github.io/web-audio-api/#panning-algorithm |
+std::unique_ptr<StereoPanner> StereoPanner::create(float sampleRate) |
+{ |
+ return wrapUnique(new StereoPanner(sampleRate)); |
+} |
-StereoPanner::StereoPanner(float sampleRate) : Spatializer(PanningModelEqualPower) |
- , m_isFirstRender(true) |
+StereoPanner::StereoPanner(float sampleRate) |
+ : m_isFirstRender(true) |
+ , m_smoothingConstant(AudioUtilities::discreteTimeConstantForSampleRate(SmoothingTimeConstant, sampleRate)) |
, m_pan(0.0) |
{ |
- // Convert smoothing time (50ms) to a per-sample time value. |
- m_smoothingConstant = AudioUtilities::discreteTimeConstantForSampleRate(SmoothingTimeConstant, sampleRate); |
Raymond Toy
2016/08/24 18:30:29
I'd prefer not changing these lines.
hongchan
2016/08/24 21:52:33
Done.
|
} |
void StereoPanner::panWithSampleAccurateValues(const AudioBus* inputBus, AudioBus* outputBus, const float* panValues, size_t framesToProcess) |
@@ -168,4 +169,3 @@ void StereoPanner::panToTargetValue(const AudioBus* inputBus, AudioBus* outputBu |
} |
} // namespace blink |
- |