Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!doctype html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <title>Osc with ExponentialRamp (crbug.com/522229)</title> | |
| 5 </head> | |
| 6 | |
| 7 <body> | |
| 8 <script> | |
| 9 var context = new AudioContext(); | |
| 10 var sawosc = 0; | |
| 11 | |
| 12 function updateOsc (event) | |
|
hongchan
2015/09/30 22:14:18
Let's be consistent with the curly brace after the
Raymond Toy
2015/10/01 18:05:55
Done. Fixed inconsistent indentation too. :-)
| |
| 13 { | |
| 14 var freq = Math.random() * 440 + 440; | |
| 15 console.log(context.currentTime); | |
| 16 sawosc.frequency.exponentialRampToValueAtTime(freq, context.currentTim e + 0.025); | |
| 17 } | |
| 18 | |
| 19 function startTest() { | |
| 20 sawosc = context.createOscillator(); | |
| 21 sawosc.type = 'sawtooth'; | |
| 22 sawosc.connect(context.destination); | |
| 23 window.addEventListener('keydown', updateOsc); | |
| 24 sawosc.start(); | |
| 25 } | |
| 26 | |
| 27 function stopTest() { | |
| 28 window.removeEventListener('keydown', updateOsc); | |
| 29 sawosc.stop(); | |
| 30 } | |
| 31 </script> | |
| 32 | |
| 33 <p> | |
| 34 Test from <a href="crbug.com/522229">crbug.com/522229</a>. This test cann ot be validated | |
| 35 using an offline context because it requires user interaction. | |
| 36 </p> | |
| 37 <p> | |
| 38 Press the start button to start the test and the stop button to stop it | |
| 39 </p> | |
| 40 <p> | |
| 41 Press any set of keys quickly and listen. At no point should audio ever b e silent. There | |
| 42 should be no glitches either. If either of these happens, this test has f ailed. | |
| 43 </p> | |
| 44 <button onclick="startTest()">Start</button> | |
| 45 <button onclick="stopTest()">Stop</button> | |
| 46 </body> | |
| 47 </html> | |
| OLD | NEW |