| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 | 3 |
| 4 <head> | 4 <head> |
| 5 <script src="../../resources/testharness.js"></script> | 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.js"></script> | 6 <script src="../../resources/testharnessreport.js"></script> |
| 7 <script src="../resources/audit-util.js"></script> | 7 <script src="../resources/audit-util.js"></script> |
| 8 <script src="../resources/audio-testing.js"></script> | 8 <script src="../resources/audio-testing.js"></script> |
| 9 <script src="../resources/audiobuffersource-testing.js"></script> | 9 <script src="../resources/audiobuffersource-testing.js"></script> |
| 10 <script src="../resources/buffer-loader.js"></script> | 10 <script src="../resources/buffer-loader.js"></script> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 // Compare two buffers with arbitrary (yet reasonable) constraints. | 50 // Compare two buffers with arbitrary (yet reasonable) constraints. |
| 51 // There parameters are determined by try bot experiments. | 51 // There parameters are determined by try bot experiments. |
| 52 compareBuffersWithConstraints(actual, expected, { | 52 compareBuffersWithConstraints(actual, expected, { |
| 53 thresholdSNR: 92.72, | 53 thresholdSNR: 92.72, |
| 54 thresholdDiffULP: 0.985, | 54 thresholdDiffULP: 0.985, |
| 55 thresholdDiffCount: 0, | 55 thresholdDiffCount: 0, |
| 56 bitDepth: 16 | 56 bitDepth: 16 |
| 57 }); | 57 }); |
| 58 | 58 |
| 59 var filename = 'audiobuffersource-playbackrate-modulation-actual.wav'; |
| 60 if (downloadAudioBuffer(renderedBuffer, filename)) |
| 61 Should("Saved reference file", true).summarize(filename, ""); |
| 59 }).then(done); | 62 }).then(done); |
| 60 }); | 63 }); |
| 61 | 64 |
| 62 // Task: Create a new reference audio file. See .runTasks() below to run | 65 audit.runTasks(); |
| 63 // this task. | |
| 64 audit.defineTask('generate-reference', function (done) { | |
| 65 if (!window.testRunner) { | |
| 66 done(); | |
| 67 return; | |
| 68 } | |
| 69 | |
| 70 // With this setting, the playback rate will be changing continuously and | |
| 71 // repeatedly within the range of [0, 200] around 100Hz, based on the | |
| 72 // input from the oscillator. | |
| 73 createSawtoothWithModulation(context, 'playbackRate', 100, 100); | |
| 74 | |
| 75 // |finishAudioTest| will automatically create a reference audio file from | |
| 76 // the OAC rendering if the reference file does not exist. | |
| 77 context.oncomplete = finishAudioTest; | |
| 78 context.startRendering(); | |
| 79 testRunner.waitUntilDone(); | |
| 80 | |
| 81 done(); | |
| 82 }); | |
| 83 | |
| 84 audit.defineTask('finish', function (done) { | |
| 85 done(); | |
| 86 }); | |
| 87 | |
| 88 window.onload = function () { | |
| 89 audit.runTasks( | |
| 90 'load-reference', | |
| 91 'generate-verify', | |
| 92 'finish' | |
| 93 ); | |
| 94 }; | |
| 95 | |
| 96 // Use this task to generate a new reference audio file. Make sure to | |
| 97 // comment out .runTasks() above before use this. | |
| 98 // audit.runTasks('generate-reference'); | |
| 99 | |
| 100 successfullyParsed = true; | |
| 101 </script> | 66 </script> |
| 102 </body> | 67 </body> |
| 103 | 68 |
| 104 </html> | 69 </html> |
| OLD | NEW |