summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-notch.html
blob: 98e6e6e02c0813692c579821b48b84959cb89367 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html>
  <head>
    <title>
      biquad-notch.html
    </title>
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
    <script src="/webaudio/resources/audit-util.js"></script>
    <script src="/webaudio/resources/audit.js"></script>
    <script src="/webaudio/resources/biquad-filters.js"></script>
    <script src="/webaudio/resources/biquad-testing.js"></script>
  </head>
  <body>
    <script id="layout-test-code">
      let audit = Audit.createTaskRunner();

      audit.define(
          {label: 'test', description: 'Biquad notch filter'},
          function(task, should) {

            // Create offline audio context.
            let context = new OfflineAudioContext(
                2, sampleRate * renderLengthSeconds, sampleRate);

            let filterParameters = [
              {cutoff: 0, q: 10, gain: 1},
              {cutoff: 1, q: 10, gain: 1},
              {cutoff: .5, q: 0, gain: 1},
              {cutoff: 0.25, q: 10, gain: 1},
            ];

            createTestAndRun(context, 'notch', {
              should: should,
              threshold: 1.9669e-8,
              filterParameters: filterParameters
            }).then(task.done.bind(task));
          });

      audit.run();
    </script>
  </body>
</html>