| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 | |
| 3 <html> | |
| 4 <head> | |
| 5 <script src="../resources/js-test.js"></script> | |
| 6 <script src="resources/compatibility.js"></script> | |
| 7 <script src="resources/audit-util.js"></script> | |
| 8 <script src="resources/audio-testing.js"></script> | |
| 9 <script src="resources/delay-testing.js"></script> | |
| 10 </head> | |
| 11 | |
| 12 <body> | |
| 13 | |
| 14 <div id="description"></div> | |
| 15 <div id="console"></div> | |
| 16 | |
| 17 <script> | |
| 18 description("Tests that DelayNode delayTime parameter can be scheduled at a give
n time."); | |
| 19 | |
| 20 function runTest() { | |
| 21 if (window.testRunner) { | |
| 22 testRunner.dumpAsText(); | |
| 23 testRunner.waitUntilDone(); | |
| 24 } | |
| 25 | |
| 26 window.jsTestIsAsync = true; | |
| 27 | |
| 28 // Create offline audio context. | |
| 29 var context = new OfflineAudioContext(1, sampleRate * renderLengthSeconds, s
ampleRate); | |
| 30 var toneBuffer = createToneBuffer(context, 20, 20 * toneLengthSeconds, sampl
eRate); // 20Hz tone | |
| 31 | |
| 32 var bufferSource = context.createBufferSource(); | |
| 33 bufferSource.buffer = toneBuffer; | |
| 34 | |
| 35 var delay = context.createDelay(); | |
| 36 | |
| 37 // Schedule delay time at time zero. | |
| 38 delay.delayTime.setValueAtTime(delayTimeSeconds, 0); | |
| 39 | |
| 40 bufferSource.connect(delay); | |
| 41 delay.connect(context.destination); | |
| 42 bufferSource.start(0); | |
| 43 | |
| 44 context.oncomplete = checkDelayedResult(toneBuffer); | |
| 45 context.startRendering(); | |
| 46 } | |
| 47 | |
| 48 runTest(); | |
| 49 | |
| 50 </script> | |
| 51 | |
| 52 </body> | |
| 53 </html> | |
| OLD | NEW |