OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../resources/testharness.js"></script> | 4 <script src="../../resources/testharness.js"></script> |
5 <script src="../../resources/testharnessreport.js"></script> | 5 <script src="../../resources/testharnessreport.js"></script> |
6 <script src="../resources/audit-util.js"></script> | 6 <script src="../resources/audit-util.js"></script> |
7 <script src="../resources/audit.js"></script> | 7 <script src="../resources/audit.js"></script> |
8 </head> | 8 </head> |
9 | 9 |
10 <body> | 10 <body> |
(...skipping 24 matching lines...) Expand all Loading... |
35 } | 35 } |
36 | 36 |
37 should(peak >= peakThreshold, "Pre-emphasis effect not applied") | 37 should(peak >= peakThreshold, "Pre-emphasis effect not applied") |
38 .beTrue(); | 38 .beTrue(); |
39 | 39 |
40 should(compressor.reduction !== 0, | 40 should(compressor.reduction !== 0, |
41 "Reduction value changed") | 41 "Reduction value changed") |
42 .beTrue(); | 42 .beTrue(); |
43 } | 43 } |
44 | 44 |
45 audit.define("test", function (task, should) { | 45 audit.define({ |
46 task.describe("Test pre-emphasis in DynamicsCompressor is removed"); | 46 label: "test", |
| 47 description: "Test pre-emphasis in DynamicsCompressor is removed" |
| 48 }, function (task, should) { |
47 | 49 |
48 context = new OfflineAudioContext(1, sampleRate * lengthInSeconds, sampl
eRate); | 50 context = new OfflineAudioContext(1, sampleRate * lengthInSeconds, sampl
eRate); |
49 // Connect an oscillator to a gain node to the compressor. The | 51 // Connect an oscillator to a gain node to the compressor. The |
50 // oscillator frequency is set to a high value for the (original) | 52 // oscillator frequency is set to a high value for the (original) |
51 // emphasis to kick in. The gain is a little extra boost to get the | 53 // emphasis to kick in. The gain is a little extra boost to get the |
52 // compressor enabled. | 54 // compressor enabled. |
53 // | 55 // |
54 var osc = context.createOscillator(); | 56 var osc = context.createOscillator(); |
55 osc.frequency.value = 15000; | 57 osc.frequency.value = 15000; |
56 var gain = context.createGain(); | 58 var gain = context.createGain(); |
57 gain.gain.value = 1.5; | 59 gain.gain.value = 1.5; |
58 compressor = context.createDynamicsCompressor(); | 60 compressor = context.createDynamicsCompressor(); |
59 osc.connect(gain); | 61 osc.connect(gain); |
60 gain.connect(compressor); | 62 gain.connect(compressor); |
61 compressor.connect(context.destination); | 63 compressor.connect(context.destination); |
62 osc.start(); | 64 osc.start(); |
63 | 65 |
64 context.startRendering() | 66 context.startRendering() |
65 .then(buffer => checkResult(buffer, should)) | 67 .then(buffer => checkResult(buffer, should)) |
66 .then(() => task.done());; | 68 .then(() => task.done());; |
67 }); | 69 }); |
68 | 70 |
69 audit.run(); | 71 audit.run(); |
70 </script> | 72 </script> |
71 | 73 |
72 </body> | 74 </body> |
73 </html> | 75 </html> |
OLD | NEW |