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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/Convolver/convolver-cascade.html

Issue 2732523003: Make ConvolverNode conform to spec (Closed)
Patch Set: Remove unneeded numberOfChannels parameter and simplify code Created 3 years, 8 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/Convolver/convolver-response-1-chan.html » ('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 <title>Test Cascade of Mono Convolvers</title>
5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script>
7 <script src="../resources/audit-util.js"></script>
8 <script src="../resources/audit.js"></script>
9 </head>
10
11 <body>
12 <script>
13 let audit = Audit.createTaskRunner();
14
15 // Arbitrary sample rate and reasonably short duration
16 let sampleRate = 8000;
17 let duration = 0.25;
18 let renderFrames = duration * sampleRate;
19
20 audit.define(
21 {label: 'cascade-mono', description: 'Cascaded mono convolvers'},
22 (task, should) => {
23 // Cascade two convolvers with mono responses and verify that the
24 // output is not silent.
25 let context = new OfflineAudioContext(1, renderFrames, sampleRate);
26
27 let b0 =
28 new AudioBuffer({length: 5, sampleRate: context.sampleRate});
29 b0.getChannelData(0)[1] = 1;
30 let c0 = new ConvolverNode(
31 context, {disableNormalization: true, buffer: b0});
32
33 let b1 =
34 new AudioBuffer({length: 5, sampleRate: context.sampleRate});
35 b1.getChannelData(0)[2] = 1;
36
37 let c1 = new ConvolverNode(
38 context, {disableNormalization: true, buffer: b1});
39
40 let src = new OscillatorNode(context);
41
42 src.connect(c0).connect(c1).connect(context.destination);
43
44 src.start();
45
46 context.startRendering()
47 .then(audioBuffer => {
48 // Just verify the output is not silent
49 let audio = audioBuffer.getChannelData(0);
50
51 should(audio, 'Output of cascaded mono convolvers')
52 .notBeConstantValueOf(0);
53 })
54 .then(() => task.done());
55 });
56
57 audit.run();
58 </script>
59 </body>
60 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/Convolver/convolver-response-1-chan.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698