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 exponentialRampToValueAtTime() functionality.");
16 // Play a long DC signal out through an AudioGainNode, and call setValueAtTime() and
17 // exponentialRampToValueAtTime() at regular intervals to set the starting and ending values
18 // for an exponential ramp. Each time interval has a ramp with a different starting and
19 // ending value so that there is a discontinuity at each time interval boundary. The
20 // discontinuity is for testing timing. Also, we alternate between an increasing and
21 // decreasing ramp for each interval.
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.75e-4;
29 // The AudioGainNode starts with this value instead of the default value.
30 var initialValue = 100;
32 // Set the gain node value to the specified value at the specified time.
33 function setValue(value, time)
35 gainNode.gain.setValueAtTime(value, time);
38 // Generate an exponential ramp ending at time |endTime| with an ending value of |value|.
39 function generateRamp(value, startTime, endTime)
41 // |startTime| is ignored because the exponential ramp
42 // uses the value from the setValueAtTime() call above.
43 gainNode.gain.exponentialRampToValueAtTime(value, endTime)
48 createAudioGraphAndTest(numberOfTests,
52 "exponentialRampToValueAtTime()",
54 createExponentialRampArray);
59 successfullyParsed = true;
63 <script src="../fast/js/resources/js-test-post.js"></script>