Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(623)

Unified Diff: third_party/WebKit/ManualTests/webaudio/osc-exponentialRamp.html

Issue 1377903002: Use frames instead of time for running AudioParam timelines. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/ManualTests/webaudio/osc-exponentialRamp.html
diff --git a/third_party/WebKit/ManualTests/webaudio/osc-exponentialRamp.html b/third_party/WebKit/ManualTests/webaudio/osc-exponentialRamp.html
new file mode 100644
index 0000000000000000000000000000000000000000..32496f3146de65155a2534b15acab0684a939df6
--- /dev/null
+++ b/third_party/WebKit/ManualTests/webaudio/osc-exponentialRamp.html
@@ -0,0 +1,46 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Osc with ExponentialRamp (crbug.com/522229)</title>
+ </head>
+
+ <body>
+ <script>
hongchan 2015/10/01 20:20:52 Let us move the script section to the end of body.
+ var context = new AudioContext();
+ var sawosc = 0;
hongchan 2015/10/01 20:20:52 0 is not necessary.
+
+ function updateOsc(event) {
+ var freq = Math.random() * 440 + 440;
hongchan 2015/10/01 20:20:52 Be sure to avoid the case freq = 0. Perhaps we can
Raymond Toy 2015/10/01 20:31:23 How can freq be 0? Math.random() returns numbers
hongchan 2015/10/01 22:14:48 Oops. Sorry. I blindly thought it is -1~1. Please
+ console.log(context.currentTime);
hongchan 2015/10/01 20:20:52 Let's remove the console print out.
+ sawosc.frequency.exponentialRampToValueAtTime(freq, context.currentTime + 0.025);
+ }
+
+ function startTest() {
+ sawosc = context.createOscillator();
+ sawosc.type = 'sawtooth';
+ sawosc.connect(context.destination);
+ window.addEventListener('keydown', updateOsc);
+ sawosc.start();
+ }
+
+ function stopTest() {
+ window.removeEventListener('keydown', updateOsc);
+ sawosc.stop();
+ }
+ </script>
+
+ <p>
+ Test from <a href="crbug.com/522229">crbug.com/522229</a>. This test cannot be validated
+ using an offline context because it requires user interaction.
+ </p>
+ <p>
+ Press the start button to start the test and the stop button to stop it
hongchan 2015/10/01 20:20:52 A missing period at the end.
+ </p>
+ <p>
+ Press any set of keys quickly and listen. At no point should audio ever be silent. There
+ should be no glitches either. If either of these happens, this test has failed.
+ </p>
+ <button onclick="startTest()">Start</button>
+ <button onclick="stopTest()">Stop</button>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698