Changeset 104987 in webkit


Ignore:
Timestamp:
Jan 13, 2012 2:18:41 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

EQUALPOWER panner incorrectly computes gain
https://bugs.webkit.org/show_bug.cgi?id=75767

Source/WebCore:

Patch by Raymond Toy <Raymond Toy> on 2012-01-13
Reviewed by Kenneth Russell.

Layout test added.

  • platform/audio/EqualPowerPanner.cpp:

(WebCore::EqualPowerPanner::pan): Correct the formula.

LayoutTests:

Patch by Raymond Toy <rtoy@chromium.org> on 2012-01-13
Reviewed by Kenneth Russell.

  • webaudio/panner-equalpower.html: Added.
  • webaudio/panner-equalpower-expected.txt: Added.
  • webaudio/resources/panner-model-testing.js: Added.
  • webaudio/resources/audio-testing.js:

(createImpulseBuffer): New common utility function.

Location:
trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r104985 r104987  
     12012-01-13  Raymond Toy   <rtoy@chromium.org>
     2        EQUALPOWER panner incorrectly computes gain
     3        https://bugs.webkit.org/show_bug.cgi?id=75767
     4
     5        Reviewed by Kenneth Russell.
     6
     7        * webaudio/panner-equalpower.html: Added.
     8        * webaudio/panner-equalpower-expected.txt: Added.
     9        * webaudio/resources/panner-model-testing.js: Added.
     10        * webaudio/resources/audio-testing.js:
     11        (createImpulseBuffer): New common utility function.
     12       
    1132012-01-13  Ojan Vafai  <ojan@chromium.org>
    214
  • trunk/LayoutTests/webaudio/resources/audio-testing.js

    r97348 r104987  
    106106    layoutTestController.notifyDone();
    107107}
     108
     109// Create an impulse in a buffer of length sampleFrameLength
     110function createImpulseBuffer(context, sampleFrameLength) {
     111    var audioBuffer = context.createBuffer(1, 1000, context.sampleRate);
     112    var n = audioBuffer.length;
     113    var dataL = audioBuffer.getChannelData(0);
     114
     115    for (var k = 0; k < n; ++k) {
     116        dataL[k] = 0;
     117    }
     118    dataL[0] = 1;
     119
     120    return audioBuffer;
     121}
  • trunk/Source/WebCore/ChangeLog

    r104985 r104987  
     12012-01-13  Raymond Toy  <rtoy@google.com>
     2
     3        EQUALPOWER panner incorrectly computes gain
     4        https://bugs.webkit.org/show_bug.cgi?id=75767
     5
     6        Reviewed by Kenneth Russell.
     7
     8        Layout test added.
     9
     10        * platform/audio/EqualPowerPanner.cpp:
     11        (WebCore::EqualPowerPanner::pan):  Correct the formula.
     12
    1132012-01-13  Ojan Vafai  <ojan@chromium.org>
    214
  • trunk/Source/WebCore/platform/audio/EqualPowerPanner.cpp

    r96745 r104987  
    8585    double desiredPanPosition = (azimuth + 90) / 180;
    8686
    87     double desiredGainL = 0.5 * cos(piDouble * desiredPanPosition) + 0.5;
    88     double desiredGainR = sqrt(1.0 - desiredGainL*desiredGainL);
     87    double desiredGainL = cos(0.5 * piDouble * desiredPanPosition);
     88    double desiredGainR = sin(0.5 * piDouble * desiredPanPosition);
    8989
    9090    // Don't de-zipper on first render call.
Note: See TracChangeset for help on using the changeset viewer.