| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | |
| 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 <script> | |
| 15 description("Test PannerNode handling of feedback loops"); | |
| 16 | |
| 17 // See crbug.com/331446. | |
| 18 | |
| 19 // Create a simple feedback loop and make sure the panner node processes i
t correctly. | |
| 20 | |
| 21 function runTest() { | |
| 22 if (window.testRunner) { | |
| 23 testRunner.dumpAsText(); | |
| 24 testRunner.waitUntilDone(); | |
| 25 } | |
| 26 | |
| 27 window.jsTestIsAsync = true; | |
| 28 | |
| 29 var sampleRate = 44100; | |
| 30 var renderLengthSeconds = 1; | |
| 31 | |
| 32 // Create offline audio context. | |
| 33 var context = new OfflineAudioContext(2, sampleRate * renderLengthSeco
nds, sampleRate); | |
| 34 | |
| 35 // Create nodes in graph. This is based on the test given in crbug.com
/331446. | |
| 36 var source = context.createBufferSource(); | |
| 37 source.buffer = createImpulseBuffer(context, sampleRate * renderLength
Seconds); | |
| 38 var activateNode = context.createGain(); | |
| 39 var dry = context.createGain(); | |
| 40 var wet = context.createGain(); | |
| 41 var filter = context.createBiquadFilter(); | |
| 42 var delay = context.createDelay(); | |
| 43 var feedbackNode = context.createGain(); | |
| 44 var output = context.createGain(); | |
| 45 | |
| 46 delay.delayTime.value = 0.1; | |
| 47 wet.gain.value = 0.5; | |
| 48 dry.gain.value = 1; | |
| 49 feedbackNode.gain.value = 0.45; | |
| 50 filter.frequency.value = 20000; | |
| 51 | |
| 52 source.connect(activateNode); | |
| 53 activateNode.connect(delay); | |
| 54 activateNode.connect(dry); | |
| 55 delay.connect(filter); | |
| 56 filter.connect(feedbackNode); | |
| 57 feedbackNode.connect(delay); | |
| 58 feedbackNode.connect(wet); | |
| 59 wet.connect(output); | |
| 60 dry.connect(output); | |
| 61 | |
| 62 var panner = context.createPanner(); | |
| 63 panner.coneOuterGain = 0.1; | |
| 64 panner.coneOuterAngle = 180; | |
| 65 panner.coneInnerAngle = 0; | |
| 66 | |
| 67 panner.connect(context.destination); | |
| 68 | |
| 69 output.connect(panner); | |
| 70 | |
| 71 // Render. We don't care what the output is, though. | |
| 72 | |
| 73 context.oncomplete = function (event) { | |
| 74 testPassed("Rendering successfully completed.
"); | |
| 75 finishJSTest(); | |
| 76 }; | |
| 77 context.startRendering(); | |
| 78 } | |
| 79 | |
| 80 runTest(); | |
| 81 successfullyParsed = true; | |
| 82 </script> | |
| 83 | |
| 84 </body> | |
| 85 </html> | |
| OLD | NEW |