OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Test Oscillator Node: sawtooth</title> | 4 <title>Test Oscillator Node: sawtooth</title> |
5 <script src="../resources/js-test.js"></script> | 5 <script src="../../resources/js-test.js"></script> |
6 <script src="resources/compatibility.js"></script> | 6 <script src="../resources/compatibility.js"></script> |
7 <script src="resources/buffer-loader.js"></script> | 7 <script src="../resources/buffer-loader.js"></script> |
8 <script src="resources/oscillator-testing.js"></script> | 8 <script src="../resources/oscillator-testing.js"></script> |
9 </head> | 9 </head> |
10 | 10 |
11 <body> | 11 <body> |
12 <script> | 12 <script> |
13 description("Test Builtin Oscillator PeriodicWave Tables"); | 13 description("Test Builtin Oscillator PeriodicWave Tables"); |
14 | 14 |
15 // Create an offline context with a sample rate that is very different fro
m the sample rate | 15 // Create an offline context with a sample rate that is very different fro
m the sample rate |
16 // used in the OscillatorTestingUtils. This will create a internal Period
icWave objects for | 16 // used in the OscillatorTestingUtils. This will create a internal Period
icWave objects for |
17 // the Oscillator. This should not interfere with the oscillator test usi
ng a different | 17 // the Oscillator. This should not interfere with the oscillator test usi
ng a different |
18 // context with a different sample rate. | 18 // context with a different sample rate. |
19 | 19 |
20 var context = new OfflineAudioContext(1, 1, 3000); | 20 var context = new OfflineAudioContext(1, 1, 3000); |
21 var osc = context.createOscillator(); | 21 var osc = context.createOscillator(); |
22 osc.type = "sawtooth"; | 22 osc.type = "sawtooth"; |
23 osc = null; | 23 osc = null; |
24 | 24 |
25 // This test is identical to the test in osc-sawtooth-sweep-snr.html. | 25 // This test is identical to the test in osc-sawtooth-sweep-snr.html. |
26 var tester = OscillatorTestingUtils; | 26 var tester = OscillatorTestingUtils; |
27 | 27 |
28 // The thresholds are experimentally determined. | 28 // The thresholds are experimentally determined. |
29 tester.setThresholds({snr: 80.00, maxDiff: 4.06, diffCount: 15827}); | 29 tester.setThresholds({snr: 80.00, maxDiff: 4.06, diffCount: 15827}); |
30 tester.runTest("sawtooth"); | 30 tester.runTest("sawtooth"); |
31 successfullyParsed = true; | 31 successfullyParsed = true; |
32 </script> | 32 </script> |
33 </body> | 33 </body> |
34 </html> | 34 </html> |
OLD | NEW |