OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../resources/js-test.js"></script> | 4 <script src="../resources/js-test.js"></script> |
5 <script src="resources/compatibility.js"></script> | 5 <script src="resources/compatibility.js"></script> |
6 <script type="text/javascript" src="resources/audio-testing.js"></script> | 6 <script type="text/javascript" src="resources/audio-testing.js"></script> |
7 </head> | 7 </head> |
8 | 8 |
9 <body> | 9 <body> |
10 <div id="description"></div> | 10 <div id="description"></div> |
11 <div id="console"></div> | 11 <div id="console"></div> |
12 | 12 |
13 <script> | 13 <script> |
14 description("Test pre-emphasis in DynamicsCompressor is removed"); | 14 description("Test pre-emphasis in DynamicsCompressor is removed"); |
15 var context; | 15 var context; |
16 var sampleRate = 44100; | 16 var sampleRate = 44100; |
17 var lengthInSeconds = 1; | 17 var lengthInSeconds = 1; |
18 var renderedData; | 18 var renderedData; |
19 // This threshold experimentally determined. It depends on the the gain va
lue of the gain node | 19 // This threshold experimentally determined. It depends on the the gain va
lue of the gain node |
20 // below and the dynamics compressor. When the DynamicsCompressor had the
pre-emphasis | 20 // below and the dynamics compressor. When the DynamicsCompressor had the
pre-emphasis |
21 // filters, the peak value is about 0.21. Without it, the peak is 0.85. | 21 // filters, the peak value is about 0.21. Without it, the peak is about 0
.84. |
22 var peakThreshold = 0.85; | 22 var peakThreshold = 0.83; |
23 | 23 |
24 function checkResult(event) { | 24 function checkResult(event) { |
25 var renderedBuffer = event.renderedBuffer; | 25 var renderedBuffer = event.renderedBuffer; |
26 renderedData = renderedBuffer.getChannelData(0); | 26 renderedData = renderedBuffer.getChannelData(0); |
27 // Search for a peak in the last part of the data. | 27 // Search for a peak in the last part of the data. |
28 var startSample = sampleRate * (lengthInSeconds - .1); | 28 var startSample = sampleRate * (lengthInSeconds - .1); |
29 var endSample = renderedData.length; | 29 var endSample = renderedData.length; |
30 var k; | 30 var k; |
31 var peak = -1; | 31 var peak = -1; |
32 | 32 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 context.startRendering(); | 73 context.startRendering(); |
74 } | 74 } |
75 | 75 |
76 runTest(); | 76 runTest(); |
77 successfullyParsed = true; | 77 successfullyParsed = true; |
78 | 78 |
79 </script> | 79 </script> |
80 | 80 |
81 </body> | 81 </body> |
82 </html> | 82 </html> |
OLD | NEW |