OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 | 2 |
3 <!-- | 3 <!-- |
4 Tests that we are able to schedule a series of notes to playback with sample-acc
uracy. | 4 Tests that we are able to schedule a series of notes to playback with sample-acc
uracy. |
5 We use an impulse so we can tell exactly where the rendering is happening. | 5 We use an impulse so we can tell exactly where the rendering is happening. |
6 --> | 6 --> |
7 | 7 |
8 <html> | 8 <html> |
9 <head> | 9 <head> |
10 <script src="../resources/js-test.js"></script> | 10 <script src="../resources/js-test.js"></script> |
| 11 <script src="resources/compatibility.js"></script> |
11 <script type="text/javascript" src="resources/audio-testing.js"></script> | 12 <script type="text/javascript" src="resources/audio-testing.js"></script> |
12 <script type="text/javascript" src="resources/buffer-loader.js"></script> | 13 <script type="text/javascript" src="resources/buffer-loader.js"></script> |
13 </head> | 14 </head> |
14 | 15 |
15 <body> | 16 <body> |
16 | 17 |
17 <div id="description"></div> | 18 <div id="description"></div> |
18 <div id="console"></div> | 19 <div id="console"></div> |
19 | 20 |
20 <script> | 21 <script> |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 107 |
107 function runTest() { | 108 function runTest() { |
108 if (window.testRunner) { | 109 if (window.testRunner) { |
109 testRunner.dumpAsText(); | 110 testRunner.dumpAsText(); |
110 testRunner.waitUntilDone(); | 111 testRunner.waitUntilDone(); |
111 } | 112 } |
112 | 113 |
113 window.jsTestIsAsync = true; | 114 window.jsTestIsAsync = true; |
114 | 115 |
115 // Create offline audio context. | 116 // Create offline audio context. |
116 context = new webkitOfflineAudioContext(2, sampleRate * lengthInSeconds, sam
pleRate); | 117 context = new OfflineAudioContext(2, sampleRate * lengthInSeconds, sampleRat
e); |
117 createImpulse(); | 118 createImpulse(); |
118 | 119 |
119 for (var i = 0; i < sampleOffsets.length; ++i) { | 120 for (var i = 0; i < sampleOffsets.length; ++i) { |
120 var timeInSeconds = sampleOffsets[i] / sampleRate; | 121 var timeInSeconds = sampleOffsets[i] / sampleRate; |
121 playNote(timeInSeconds); | 122 playNote(timeInSeconds); |
122 } | 123 } |
123 | 124 |
124 context.oncomplete = checkSampleAccuracy; | 125 context.oncomplete = checkSampleAccuracy; |
125 context.startRendering(); | 126 context.startRendering(); |
126 } | 127 } |
127 | 128 |
128 runTest(); | 129 runTest(); |
129 | 130 |
130 </script> | 131 </script> |
131 | 132 |
132 </body> | 133 </body> |
133 </html> | 134 </html> |
OLD | NEW |