Changeset 86801 in webkit
- Timestamp:
- May 18, 2011 4:14:25 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r86798 r86801 1 2011-05-18 Chris Rogers <crogers@google.com> 2 3 Reviewed by James Robinson. 4 5 EqualPowerPanner is not using the correct azimuth range for stereo panning 6 https://bugs.webkit.org/show_bug.cgi?id=61085 7 8 No new tests since audio API is not yet implemented. 9 10 * platform/audio/EqualPowerPanner.cpp: 11 (WebCore::EqualPowerPanner::pan): 12 1 13 2011-05-18 Yi Shen <yi.4.shen@nokia.com> 2 14 -
trunk/Source/WebCore/platform/audio/EqualPowerPanner.cpp
r73458 r86801 31 31 #include "AudioBus.h" 32 32 #include "AudioUtilities.h" 33 #include <algorithm> 33 34 #include <wtf/MathExtras.h> 34 35 35 36 // Use a 50ms smoothing / de-zippering time-constant. 36 37 const double SmoothingTimeConstant = 0.050; 37 38 39 using namespace std; 40 38 41 namespace WebCore { 39 42 … … 68 71 return; 69 72 70 // Pan smoothly from left to right with azimuth going from -30 -> +30 degrees. 71 double desiredPanPosition; 72 if (azimuth > 30.0) 73 desiredPanPosition = 1.0; 74 else if (azimuth < -30.0) 75 desiredPanPosition = 0.0; 76 else 77 desiredPanPosition = (azimuth + 30.0) / 60.0; 73 // Clamp azimuth to allowed range of -180 -> +180. 74 azimuth = max(-180.0, azimuth); 75 azimuth = min(180.0, azimuth); 76 77 // Alias the azimuth ranges behind us to in front of us: 78 // -90 -> -180 to -90 -> 0 and 90 -> 180 to 90 -> 0 79 if (azimuth < -90) 80 azimuth = -180 - azimuth; 81 else if (azimuth > 90) 82 azimuth = 180 - azimuth; 83 84 // Pan smoothly from left to right with azimuth going from -90 -> +90 degrees. 85 double desiredPanPosition = (azimuth + 90) / 180; 78 86 79 87 double desiredGainL = 0.5 * cos(piDouble * desiredPanPosition) + 0.5;
Note: See TracChangeset
for help on using the changeset viewer.