| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 | 2 |
| 3 <html> | 3 <html> |
| 4 <head> | 4 <head> |
| 5 <link rel="stylesheet" href="../fast/js/resources/js-test-style.css"/> | 5 <link rel="stylesheet" href="../fast/js/resources/js-test-style.css"/> |
| 6 <script src="resources/audio-testing.js"></script> | 6 <script src="resources/audio-testing.js"></script> |
| 7 <script src="resources/audiobuffersource-testing.js"></script> | 7 <script src="resources/audiobuffersource-testing.js"></script> |
| 8 <script src="../fast/js/resources/js-test-pre.js"></script> | 8 <script src="../fast/js/resources/js-test-pre.js"></script> |
| 9 </head> | 9 </head> |
| 10 | 10 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 var bufferFrameLength = 8; | 68 var bufferFrameLength = 8; |
| 69 var testSpacingFrames = 32; | 69 var testSpacingFrames = 32; |
| 70 var testSpacingSeconds = testSpacingFrames / sampleRate; | 70 var testSpacingSeconds = testSpacingFrames / sampleRate; |
| 71 var totalRenderLengthFrames = tests.length * testSpacingFrames; | 71 var totalRenderLengthFrames = tests.length * testSpacingFrames; |
| 72 | 72 |
| 73 function runLoopTest(context, testNumber, test) { | 73 function runLoopTest(context, testNumber, test) { |
| 74 var source = context.createBufferSource(); | 74 var source = context.createBufferSource(); |
| 75 | 75 |
| 76 source.buffer = buffer; | 76 source.buffer = buffer; |
| 77 source.playbackRate.value = test.playbackRate; | 77 source.playbackRate.value = test.playbackRate; |
| 78 source.loop = true; | 78 source.looping = true; |
| 79 source.loopStart = test.loopStartFrame / context.sampleRate; | 79 source.loopStart = test.loopStartFrame / context.sampleRate; |
| 80 source.loopEnd = test.loopEndFrame / context.sampleRate; | 80 source.loopEnd = test.loopEndFrame / context.sampleRate; |
| 81 | 81 |
| 82 source.connect(context.destination); | 82 source.connect(context.destination); |
| 83 | 83 |
| 84 // Render each test one after the other, spaced apart by testSpacingSeconds. | 84 // Render each test one after the other, spaced apart by testSpacingSeconds. |
| 85 var startTime = testNumber * testSpacingSeconds; | 85 var startTime = testNumber * testSpacingSeconds; |
| 86 var duration = test.renderFrames / context.sampleRate; | 86 var duration = test.renderFrames / context.sampleRate; |
| 87 source.start(startTime); | 87 source.start(startTime); |
| 88 source.stop(startTime + duration); | 88 source.stop(startTime + duration); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 108 } | 108 } |
| 109 | 109 |
| 110 runTest(); | 110 runTest(); |
| 111 successfullyParsed = true; | 111 successfullyParsed = true; |
| 112 | 112 |
| 113 </script> | 113 </script> |
| 114 | 114 |
| 115 <script src="../fast/js/resources/js-test-post.js"></script> | 115 <script src="../fast/js/resources/js-test-post.js"></script> |
| 116 </body> | 116 </body> |
| 117 </html> | 117 </html> |
| OLD | NEW |