1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">
4 <script src=
"resources/compatibility.js"></script>
5 <script src=
"resources/audio-testing.js"></script>
6 <script src=
"resources/audioparam-testing.js"></script>
7 <script src=
"../resources/js-test.js"></script>
11 <div id=
"description"></div>
12 <div id=
"console"></div>
15 description("Test AudioParam setValueAtTime() functionality.");
17 // Play a long DC signal out through an AudioGainNode, and call setValueAtTime() at regular
18 // intervals to set the value for the duration of the interval. Each time interval has
19 // different value so that there is a discontinuity at each time interval boundary. The
20 // discontinuity is for testing timing.
22 // Number of tests to run.
23 var numberOfTests
= 100;
25 // Max allowed difference between the rendered data and the expected result.
26 var maxAllowedError
= 6e-8;
28 // Set the gain node value to the specified value at the specified time.
29 function setValue(value
, time
)
31 gainNode
.gain
.setValueAtTime(value
, time
);
34 // For testing setValueAtTime(), we don't need to do anything for automation. because the value at
35 // the beginning of the interval is set by setValue and it remains constant for the duration, which
37 function automation(value
, startTime
, endTime
)
44 createAudioGraphAndTest(numberOfTests
,
54 successfullyParsed
= true;