| 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 </head> | 8 </head> |
| 9 | 9 |
| 10 <body> | 10 <body> |
| 11 <div id="description"></div> | 11 <div id="description"></div> |
| 12 <div id="console"></div> | 12 <div id="console"></div> |
| 13 | 13 |
| 14 <script> | 14 <script> |
| 15 description("Test AudioParam setTargetAtTime() functionality."); | 15 description("Test AudioParam setTargetAtTime() functionality."); |
| 16 | 16 |
| 17 // Play a long DC signal out through an AudioGainNode, and call setValueAtTime()
and | 17 // 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 | 18 // 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 | 19 // 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 | 20 // 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. | 21 // timing. Also, we alternate between an increasing and decreasing ramp for eac
h interval. |
| 22 | 22 |
| 23 // Number of tests to run. | 23 // Number of tests to run. |
| 24 var numberOfTests = 100; | 24 var numberOfTests = 100; |
| 25 | 25 |
| 26 // Max allowed difference between the rendered data and the expected result. | 26 // Max allowed difference between the rendered data and the expected result. |
| 27 var maxAllowedError = 2.79e-5; | 27 var maxAllowedError = 3.9e-5; |
| 28 | 28 |
| 29 // The AudioGainNode starts with this value instead of the default value. | 29 // The AudioGainNode starts with this value instead of the default value. |
| 30 var initialValue = 100; | 30 var initialValue = 100; |
| 31 | 31 |
| 32 // Set the gain node value to the specified value at the specified time. | 32 // Set the gain node value to the specified value at the specified time. |
| 33 function setValue(value, time) | 33 function setValue(value, time) |
| 34 { | 34 { |
| 35 gainNode.gain.setValueAtTime(value, time); | 35 gainNode.gain.setValueAtTime(value, time); |
| 36 } | 36 } |
| 37 | 37 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 53 createExponentialApproachArray); | 53 createExponentialApproachArray); |
| 54 } | 54 } |
| 55 | 55 |
| 56 runTest(); | 56 runTest(); |
| 57 successfullyParsed = true; | 57 successfullyParsed = true; |
| 58 | 58 |
| 59 </script> | 59 </script> |
| 60 | 60 |
| 61 </body> | 61 </body> |
| 62 </html> | 62 </html> |
| OLD | NEW |