OLD | NEW |
| (Empty) |
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | |
2 <html> | |
3 <head> | |
4 <script src="../resources/js-test.js"></script> | |
5 <script src="resources/compatibility.js"></script> | |
6 <script src="resources/audit-util.js"></script> | |
7 <script src="resources/audio-testing.js"></script> | |
8 <script src="resources/audioparam-testing.js"></script> | |
9 </head> | |
10 | |
11 <body> | |
12 <div id="description"></div> | |
13 <div id="console"></div> | |
14 | |
15 <script> | |
16 description("Test AudioParam setValueAtTime() functionality."); | |
17 | |
18 // Play a long DC signal out through an AudioGainNode, and call setValueAtTime()
at regular | |
19 // intervals to set the value for the duration of the interval. Each time inter
val has | |
20 // different value so that there is a discontinuity at each time interval bounda
ry. The | |
21 // discontinuity is for testing timing. | |
22 | |
23 // Number of tests to run. | |
24 var numberOfTests = 100; | |
25 | |
26 // Max allowed difference between the rendered data and the expected result. | |
27 var maxAllowedError = 6e-8; | |
28 | |
29 // Set the gain node value to the specified value at the specified time. | |
30 function setValue(value, time) | |
31 { | |
32 gainNode.gain.setValueAtTime(value, time); | |
33 } | |
34 | |
35 // For testing setValueAtTime(), we don't need to do anything for automation. be
cause the value at | |
36 // the beginning of the interval is set by setValue and it remains constant for
the duration, which | |
37 // is what we want. | |
38 function automation(value, startTime, endTime) | |
39 { | |
40 // Do nothing. | |
41 } | |
42 | |
43 function runTest() | |
44 { | |
45 createAudioGraphAndTest(numberOfTests, | |
46 1, | |
47 setValue, | |
48 automation, | |
49 "setValueAtTime()", | |
50 maxAllowedError, | |
51 createConstantArray); | |
52 } | |
53 | |
54 runTest(); | |
55 successfullyParsed = true; | |
56 | |
57 </script> | |
58 | |
59 </body> | |
60 </html> | |
OLD | NEW |