[Webkit-unassigned] [Bug 77856] New: Have the DynamicsCompressorNode support multi-channel data

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Feb 5 23:29:13 PST 2012


           Summary: Have the DynamicsCompressorNode support multi-channel
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Web Audio
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: rgbbones at gmail.com
                CC: crogers at google.com


Current DynamicsCompressorNode only support mono and stereo audio data. need to add the support for multi channel.

And current DynamicsCompressorNode seems do not handle stereo audio data well. when measure the compressor input level, it take the average of left and right channel data as :

  compressorInput = 0.5f * (undelayedL + undelayedR);

While this is not reasonable. suppose left channel and right channel have the same sin wave but with phase difference of PI, then the compressorInput will always be 0, thus lead to wrong compressor gain.

I think it might be better to have

 compressorInput = 0.5f * (abs(undelayedL) + abs(undelayedR));

while, I still think this is not quite reasonable, since the purpose here is to figure out the common gain for both channel so that the sound won't shift position, at the same time it should also have each channel be compressed correctly. when we support more channels, say 5.1 channels, if only 1 channel has loud volume, the average of all channel will be very low thus this very channel won't get compressed correctly.

Thus I think

 compressorInput = max(abs(undelayedL), abs(undelayedR)) might be even better.

I would like to provide a patch to handle multiple channels and have this issue fix at the same time. Any comments?

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list