OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="resources/compatibility.js"></script> | 4 <script src="resources/compatibility.js"></script> |
5 <script src="resources/audio-testing.js"></script> | 5 <script src="resources/audio-testing.js"></script> |
6 <script src="resources/audioparam-testing.js"></script> | 6 <script src="resources/audioparam-testing.js"></script> |
7 <script src="../resources/js-test.js"></script> | 7 <script src="../resources/js-test.js"></script> |
| 8 <title>Test AudioParam.setTargetAtTime</title> |
8 </head> | 9 </head> |
9 | 10 |
10 <body> | 11 <body> |
11 <div id="description"></div> | 12 <div id="description"></div> |
12 <div id="console"></div> | 13 <div id="console"></div> |
13 | 14 |
14 <script> | 15 <script> |
15 description("Test AudioParam setTargetAtTime() functionality."); | 16 description("Test AudioParam setTargetAtTime() functionality."); |
16 | 17 |
17 // Play a long DC signal out through an AudioGainNode, and call setValueAtTime()
and | 18 // Play a long DC signal out through an AudioGainNode, and call setValueAtTime()
and |
18 // setTargetAtTime at regular intervals to set the starting value and the target | 19 // setTargetAtTime at regular intervals to set the starting value and the target |
19 // value. Each time interval has a ramp with a different starting and target val
ue so that | 20 // value. Each time interval has a ramp with a different starting and target val
ue so that |
20 // there is a discontinuity at each time interval boundary. The discontinuity i
s for testing | 21 // there is a discontinuity at each time interval boundary. The discontinuity i
s for testing |
21 // timing. Also, we alternate between an increasing and decreasing ramp for eac
h interval. | 22 // timing. Also, we alternate between an increasing and decreasing ramp for eac
h interval. |
22 | 23 |
23 // Number of tests to run. | 24 // Number of tests to run. |
24 var numberOfTests = 100; | 25 var numberOfTests = 100; |
25 | 26 |
26 // Max allowed difference between the rendered data and the expected result. | 27 // Max allowed difference between the rendered data and the expected result. |
27 var maxAllowedError = 3.9e-5; | 28 var maxAllowedError = 6.273e-7; |
28 | 29 |
29 // The AudioGainNode starts with this value instead of the default value. | 30 // The AudioGainNode starts with this value instead of the default value. |
30 var initialValue = 100; | 31 var initialValue = 100; |
31 | 32 |
32 // Set the gain node value to the specified value at the specified time. | 33 // Set the gain node value to the specified value at the specified time. |
33 function setValue(value, time) | 34 function setValue(value, time) |
34 { | 35 { |
35 gainNode.gain.setValueAtTime(value, time); | 36 gainNode.gain.setValueAtTime(value, time); |
36 } | 37 } |
37 | 38 |
(...skipping 15 matching lines...) Expand all Loading... |
53 createExponentialApproachArray); | 54 createExponentialApproachArray); |
54 } | 55 } |
55 | 56 |
56 runTest(); | 57 runTest(); |
57 successfullyParsed = true; | 58 successfullyParsed = true; |
58 | 59 |
59 </script> | 60 </script> |
60 | 61 |
61 </body> | 62 </body> |
62 </html> | 63 </html> |
OLD | NEW |