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

Side by Side Diff: LayoutTests/webaudio/audiobuffersource-loop-points.html

Issue 191653002: Shorten duration of audio in audiobuffersource-loop-points WebAudio test (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 2
3 <!-- 3 <!--
4 Tests that AudioBufferSourceNode supports loop-points with .loopStart and .loopE nd. 4 Tests that AudioBufferSourceNode supports loop-points with .loopStart and .loopE nd.
5 --> 5 -->
6 6
7 <html> 7 <html>
8 <head> 8 <head>
9 <script type="text/javascript" src="resources/audio-testing.js"></script> 9 <script type="text/javascript" src="resources/audio-testing.js"></script>
10 10
11 </head> 11 </head>
12 <body> 12 <body>
13 13
14 <script> 14 <script>
15 15
16 window.onload = init; 16 window.onload = init;
17 17
18 var sampleRate = 44100.0; 18 var sampleRate = 44100.0;
19 var numberOfNotes = 72; // play over a 6 octave range 19 var numberOfNotes = 60; // play over a 5 octave range
20 var noteDuration = 0.100; 20 var noteDuration = 0.025;
21 var noteSpacing = noteDuration + 0.005; // leave 5ms of silence between each "no te" 21 var noteSpacing = noteDuration + 0.005; // leave 5ms of silence between each "no te"
22 var lengthInSeconds = numberOfNotes * noteSpacing; 22 var lengthInSeconds = numberOfNotes * noteSpacing;
23 23
24 var context = 0; 24 var context = 0;
25 var buffer = 0; 25 var buffer = 0;
26 26
27 function createTestBuffer(frequency, sampleRate) { 27 function createTestBuffer(frequency, sampleRate) {
28 // Create a buffer containing two periods at this frequency. 28 // Create a buffer containing two periods at this frequency.
29 // The 1st half is a pure sine wave period scaled by a linear ramp from 0 -> 1. 29 // The 1st half is a pure sine wave period scaled by a linear ramp from 0 -> 1.
30 // The 2nd half of the buffer corresponds exactly to one pure sine wave peri od. 30 // The 2nd half of the buffer corresponds exactly to one pure sine wave peri od.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 context.oncomplete = finishAudioTest; 102 context.oncomplete = finishAudioTest;
103 context.startRendering(); 103 context.startRendering();
104 104
105 testRunner.waitUntilDone(); 105 testRunner.waitUntilDone();
106 } 106 }
107 107
108 </script> 108 </script>
109 109
110 </body> 110 </body>
111 </html> 111 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698