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