OLD | NEW |
| (Empty) |
1 <!doctype html> | |
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/panner-model-testing.js"></script> | |
9 </head> | |
10 | |
11 <body> | |
12 <div id="description"></div> | |
13 <div id="console"></div> | |
14 | |
15 <script> | |
16 description("Test equal-power panner model of AudioPannerNode with stereo
source."); | |
17 | |
18 // To test the panner, we create a number of panner nodes | |
19 // equally spaced on a semicircle at unit distance. The | |
20 // semicircle covers the azimuth range from -90 to 90 deg, | |
21 // covering full left to full right. Each source is an impulse | |
22 // turning at a different time and we check that the rendered | |
23 // impulse has the expected gain. | |
24 function runTest() { | |
25 if (window.testRunner) { | |
26 testRunner.dumpAsText(); | |
27 testRunner.waitUntilDone(); | |
28 } | |
29 | |
30 window.jsTestIsAsync = true; | |
31 | |
32 // Create offline audio context. | |
33 context = new OfflineAudioContext(2, sampleRate * renderLengthSeconds,
sampleRate); | |
34 | |
35 createTestAndRun(context, nodesToCreate, 2, function (panner, x, y, z)
{ | |
36 panner.positionX.value = x; | |
37 panner.positionY.value = y; | |
38 panner.positionZ.value = z; | |
39 }); | |
40 } | |
41 | |
42 runTest(); | |
43 successfullyParsed = true; | |
44 | |
45 </script> | |
46 | |
47 </body> | |
48 </html> | |
OLD | NEW |