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.
(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
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
(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
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.