Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/realtimeanalyser-zero.html

Issue 1729783002: Don't clip FFT output values to minDecibels. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/realtimeanalyser-zero-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <head>
4 <script src="../resources/js-test.js"></script>
5 <script src="resources/compatibility.js"></script>
6 <script src="resources/audio-testing.js"></script>
7 <title>Test getFloatFrequencyData With Zero Inputs</title>
8 </head>
9
10 <body>
11 <script>
12 description("Test AnalyserNode getFloatFrequencyData With Zero-Valued Inpu t");
13 window.jsTestIsAsync = true;
14
15 var sampleRate = 48000;
16
17 // Render enough data to run the test.
18 var renderFrames = 2*1024;
19 var renderDuration = renderFrames / sampleRate;
20
21 var audit = Audit.createTaskRunner();
22
23
24 // Test that getFloatFrequencyData returns -Infinity when the input is all -zeroes.
25 audit.defineTask("zero input", function (done) {
26 var context = new OfflineAudioContext(1, renderFrames, sampleRate);
27
28 // Constant source of 0's.
29 var source = context.createBufferSource();
30 source.buffer = createConstantBuffer(context, 1, 0);
31 source.loop = true;
32
33 // Create analyser and use some non-default minDecibels value.
34 var analyser = context.createAnalyser();
35 analyser.minDecibels = -123;
36
37 source.connect(analyser);
38 analyser.connect(context.destination);
39
40 source.start();
41
42 // Suspend after some number of frames and grab the float frequency data .
43 context.suspend(1024 / sampleRate).then(function () {
44 var f = new Float32Array(analyser.frequencyBinCount);
45 analyser.getFloatFrequencyData(f);
46
47 Should("getFloatFrequencyData() with zero-valued input", f)
48 .beConstantValueOf(-Infinity);
49 }).then(context.resume.bind(context));
50
51 context.startRendering().then(done);
52 });
53
54 audit.defineTask("finish", function (done) {
55 finishJSTest();
56 done();
57 });
58
59 audit.runTasks();
60
61 </script>
62 </body>
63 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/realtimeanalyser-zero-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698