1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">
4 <script src=
"resources/compatibility.js"></script>
5 <script src=
"resources/audio-testing.js"></script>
6 <script src=
"../resources/js-test.js"></script>
7 <script src=
"resources/panner-model-testing.js"></script>
11 <div id=
"description"></div>
12 <div id=
"console"></div>
14 description("Test PannerNode handling of feedback loops");
16 // See crbug.com/331446.
18 // Create a simple feedback loop and make sure the panner node processes it correctly.
21 if (window
.testRunner
) {
22 testRunner
.dumpAsText();
23 testRunner
.waitUntilDone();
26 window
.jsTestIsAsync
= true;
28 var sampleRate
= 44100;
29 var renderLengthSeconds
= 1;
31 // Create offline audio context.
32 var context
= new OfflineAudioContext(2, sampleRate
* renderLengthSeconds
, sampleRate
);
34 // Create nodes in graph. This is based on the test given in crbug.com/331446.
35 var source
= context
.createBufferSource();
36 source
.buffer
= createImpulseBuffer(context
, sampleRate
* renderLengthSeconds
);
37 var activateNode
= context
.createGain();
38 var dry
= context
.createGain();
39 var wet
= context
.createGain();
40 var filter
= context
.createBiquadFilter();
41 var delay
= context
.createDelay();
42 var feedbackNode
= context
.createGain();
43 var output
= context
.createGain();
45 delay
.delayTime
.value
= 0.1;
48 feedbackNode
.gain
.value
= 0.45;
49 filter
.frequency
.value
= 20000;
51 source
.connect(activateNode
);
52 activateNode
.connect(delay
);
53 activateNode
.connect(dry
);
54 delay
.connect(filter
);
55 filter
.connect(feedbackNode
);
56 feedbackNode
.connect(delay
);
57 feedbackNode
.connect(wet
);
61 var panner
= context
.createPanner();
62 panner
.coneOuterGain
= 0.1;
63 panner
.coneOuterAngle
= 180;
64 panner
.coneInnerAngle
= 0;
66 panner
.connect(context
.destination
);
68 output
.connect(panner
);
70 // Render. We don't care what the output is, though.
72 context
.oncomplete = function (event
) {
73 testPassed("Rendering successfully completed.");
76 context
.startRendering();
80 successfullyParsed
= true;