OLD | NEW |
1 <!doctype html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
| 4 <title> |
| 5 panner-equalpower.html |
| 6 </title> |
4 <script src="../../resources/testharness.js"></script> | 7 <script src="../../resources/testharness.js"></script> |
5 <script src="../../resources/testharnessreport.js"></script> | 8 <script src="../../resources/testharnessreport.js"></script> |
6 <script src="../resources/audit-util.js"></script> | 9 <script src="../resources/audit-util.js"></script> |
7 <script src="../resources/audit.js"></script> | 10 <script src="../resources/audit.js"></script> |
8 <script src="../resources/panner-model-testing.js"></script> | 11 <script src="../resources/panner-model-testing.js"></script> |
9 </head> | 12 </head> |
10 | |
11 <body> | 13 <body> |
12 <script> | 14 <script id="layout-test-code"> |
13 let audit = Audit.createTaskRunner(); | 15 let audit = Audit.createTaskRunner(); |
14 | 16 |
15 // To test the panner, we create a number of panner nodes | 17 // To test the panner, we create a number of panner nodes |
16 // equally spaced on a semicircle at unit distance. The | 18 // equally spaced on a semicircle at unit distance. The |
17 // semicircle covers the azimuth range from -90 to 90 deg, | 19 // semicircle covers the azimuth range from -90 to 90 deg, |
18 // covering full left to full right. Each source is an impulse | 20 // covering full left to full right. Each source is an impulse |
19 // turning at a different time and we check that the rendered | 21 // turning at a different time and we check that the rendered |
20 // impulse has the expected gain. | 22 // impulse has the expected gain. |
21 audit.define( | 23 audit.define( |
22 { | 24 { |
23 label: 'test', | 25 label: 'test', |
24 description: 'Equal-power panner model of AudioPannerNode', | 26 description: 'Equal-power panner model of AudioPannerNode', |
25 }, | 27 }, |
26 (task, should) => { | 28 (task, should) => { |
27 // Create offline audio context. | 29 // Create offline audio context. |
28 context = new OfflineAudioContext( | 30 context = new OfflineAudioContext( |
29 2, sampleRate * renderLengthSeconds, sampleRate); | 31 2, sampleRate * renderLengthSeconds, sampleRate); |
30 | 32 |
31 createTestAndRun( | 33 createTestAndRun( |
32 context, should, nodesToCreate, 1, | 34 context, should, nodesToCreate, 1, |
33 function(panner, x, y, z) { | 35 function(panner, x, y, z) { |
34 panner.setPosition(x, y, z); | 36 panner.setPosition(x, y, z); |
35 }) | 37 }) |
36 .then(() => task.done()); | 38 .then(() => task.done()); |
37 ; | 39 ; |
38 }); | 40 }); |
39 | 41 |
40 audit.run(); | 42 audit.run(); |
41 </script> | 43 </script> |
42 | |
43 </body> | 44 </body> |
44 </html> | 45 </html> |
OLD | NEW |