Bug 105625 - WaveShaperNode not functioning properly
Summary: WaveShaperNode not functioning properly
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Major
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-21 02:52 PST by kdj
Modified: 2013-01-15 23:34 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kdj 2012-12-21 02:52:30 PST
WaveShaperNode has setCurve functionality to set the user defined curve.
But as per W3C the curve should get arrange between values -1 to 1, with 0 being as centre.

Here below is the example:
                var value = new Float32Array(3);
                value[0] = 0.1;
                value[1] = 0.23;
                value[2] = -1;
                value[3] = 0;
Use setCurve to set this curve to node. Then after processing WaveShaper node; expected output is
                value[0] = -1;
                value[1] = 0;
                value[2] = 0.1;
                value[3] = 0.23;

The following more on this, WaveShaperNode.h has process method which should eventually call WaveShaperProcessor::process() to perform the expected functionality. But the WaveShaperProcessor::process() function is not getting called.
Comment 1 Chris Rogers 2012-12-21 10:41:58 PST
(In reply to comment #0)
> WaveShaperNode has setCurve functionality to set the user defined curve.
> But as per W3C the curve should get arrange between values -1 to 1, with 0 being as centre.
> 
> Here below is the example:
>                 var value = new Float32Array(3);
>                 value[0] = 0.1;
>                 value[1] = 0.23;
>                 value[2] = -1;
>                 value[3] = 0;
> Use setCurve to set this curve to node. Then after processing WaveShaper node; expected output is
>                 value[0] = -1;
>                 value[1] = 0;
>                 value[2] = 0.1;
>                 value[3] = 0.23;
> 
> The following more on this, WaveShaperNode.h has process method which should eventually call WaveShaperProcessor::process() to perform the expected functionality. But the WaveShaperProcessor::process() function is not getting called.

I'm not sure I understand your test here.  Are you expecting the "value" ArrayBuffer to somehow be modified?  That's not what is supposed to happen.

Have you looked at the layout test?
https://svn.webkit.org/repository/webkit/trunk/LayoutTests/webaudio/waveshaper.html
Comment 2 kdj 2013-01-07 05:59:25 PST
Hi Chris,
Thanks for reply.

Please provide info on some points,about Layout Test example:

generateInputBuffer() is generating the buffer with values ranging from -1 to 1. 
generateWaveShapingCurve() is the input curve.
checkShapedCurve() checks the shaping of curve as per generated curve.

Here actual values in generated curve are floored between values -1 to 1 and it has been performed by checkShapedCurve() and not by WaveShaperNode.

Please share info and rectify the understanding.

Thanks
kaustubh
Comment 3 Chris Rogers 2013-01-07 12:55:23 PST
(In reply to comment #2)
> Hi Chris,
> Thanks for reply.
> 
> Please provide info on some points,about Layout Test example:
> 
> generateInputBuffer() is generating the buffer with values ranging from -1 to 1. 
> generateWaveShapingCurve() is the input curve.
> checkShapedCurve() checks the shaping of curve as per generated curve.
> 
> Here actual values in generated curve are floored between values -1 to 1 and it has been performed by checkShapedCurve() and not by WaveShaperNode.
> 
> Please share info and rectify the understanding.
> 
> Thanks
> kaustubh

I think you're misunderstanding, because generateInputBuffer() is the input to the WaveShaperNode, generateWaveShapingCurve() is the curve.  Please read the specification in the WaveShaperNode section for the exact technical details:

https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#WaveShaperNode
Comment 4 kdj 2013-01-15 23:34:47 PST
As the behavior of Node is differently taken and in our test case the input curve need to be given, so marking it as resolved-invalid.

Thanks for clarification.