1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <script src="resources/audio-testing.js"></script>
5 <script src="resources/audioparam-testing.js"></script>
6 <script src="../fast/js/resources/js-test-pre.js"></script>
10 <div id="description"></div>
11 <div id="console"></div>
14 description("Test AudioParam linearRampToValueAtTime() functionality.");
16 // Play a long DC signal out through an AudioGainNode, and call setValueAtTime() and
17 // linearRampToValueAtTime() at regular intervals to set the starting and ending values for a
18 // linear ramp. Each time interval has a ramp with a different starting and ending value so
19 // that there is a discontinuity at each time interval boundary. The discontinuity is for
20 // testing timing. Also, we alternate between an increasing and decreasing ramp for each
23 // Number of tests to run.
24 var numberOfTests = 100;
26 // Max allowed difference between the rendered data and the expected result.
27 var maxAllowedError = 6.5e-7;
29 // Set the gain node value to the specified value at the specified time.
30 function setValue(value, time)
32 gainNode.gain.setValueAtTime(value, time);
35 // Generate a linear ramp ending at time |endTime| with an ending value of |value|.
36 function generateRamp(value, startTime, endTime)
38 // |startTime| is ignored because the linear ramp uses the value from the setValueAtTime() call above.
39 gainNode.gain.linearRampToValueAtTime(value, endTime)
44 createAudioGraphAndTest(numberOfTests,
48 "linearRampToValueAtTime()",
50 createLinearRampArray);
54 successfullyParsed = true;
58 <script src="../fast/js/resources/js-test-post.js"></script>