Closed Bug 1313058 Opened 3 years ago Closed 3 years ago

SetValueCurveAtTime interpolation is incorrect

Categories

(Core :: Web Audio, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: dminor, Assigned: dminor)

References

Details

Attachments

(1 file)

For instance, if the curve is [1.0, 0.0] the values are interpolated from 1.0 to 0.0 over the first half of the duration, and are 0.0 for the second half of the duration. This is likely related to the old behaviour of jumping to the next value once we are closer to it than the current value.
Sorry I messed this up the first time around :/.

I also tried the [1.0, 0.5, 0.75, 0.25] curve on an 128 sample OfflineAudioContext buffer and compared results to Chrome to ensure that with the new changes we match what they are doing.
Comment on attachment 8805105 [details]
Bug 1313058 - Fix SetValueCurveAtTime interpolation;

https://reviewboard.mozilla.org/r/88954/#review89648

::: dom/media/webaudio/compiledtest/TestAudioEventTimeline.cpp:108
(Diff revision 1)
>    ErrorResultMock rv;
>  
> -  float curve[] = { -1.0f, 0.0f, 1.0f };
> +  uint32_t curveLength = 44100;
> +  float* curve = new float[curveLength];
> +  for (uint32_t i = 0; i < curveLength; ++i) {
> +    curve[i] = sin(3.14159265358979 * i / float(curveLength));

M_PI ?
Attachment #8805105 - Flags: review?(padenot) → review+
Pushed by dminor@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9bb46ea431c6
Fix SetValueCurveAtTime interpolation; r=padenot
https://hg.mozilla.org/mozilla-central/rev/9bb46ea431c6
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.