Bug 175112 - AudioParam.setValueCurveAtTime should use linear interpolation, not nearest neighbor
Summary: AudioParam.setValueCurveAtTime should use linear interpolation, not nearest n...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: Safari 10
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-08-02 20:00 PDT by Ricci Adams
Modified: 2017-08-02 22:25 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ricci Adams 2017-08-02 20:00:39 PDT
Based on testing and a brief code examination of AudioParamTimeline.cpp, AudioParam.setValueCurveAtTime is performing nearest neighbor sampling for missing values, rather than linear interpolation.

Per the WebAudio specification, linear interpolation should be used:
https://webaudio.github.io/web-audio-api/#widl-AudioParam-setValueCurveAtTime-AudioParam-sequence-float--values-double-startTime-double-duration

Chrome 46+ and Firefox use linear interpolation.

My test case involved making a Float32 array with 2 values: 1.0 and 0.0. I then used this on a GainNode to perform a fadeout. Expected behavior was a fadeout, actual behavior was immediate silence.
Comment 1 Radar WebKit Bug Importer 2017-08-02 22:25:24 PDT
<rdar://problem/33693466>