summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/webaudio/biquad-lowpass.html
blob: 7ebdf0117dd2259fd7483543b66f2961cc51d499 (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
44
45
46
47
48
49
50
<!DOCTYPE html>

<html>
<head>
<link rel="stylesheet" href="../fast/js/resources/js-test-style.css"/>
<script src="resources/audio-testing.js"></script>
<script src="../fast/js/resources/js-test-pre.js"></script>
<script src="resources/biquad-testing.js"></script>
</head>

<body>

<div id="description"></div>
<div id="console"></div>

<script>
description("Tests Biquad lowpass filter.");

function runTest() {
    if (window.testRunner) {
        testRunner.dumpAsText();
        testRunner.waitUntilDone();
    }
    
    window.jsTestIsAsync = true;
        
    // Create offline audio context.
    var context = new webkitOfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate);

    // Dummy filter to get filter type constant
    var f = context.createBiquadFilter();

    // The filters we want to test.
    var filterParameters = [{cutoff : 0,    q : 1, gain : 1 },
                            {cutoff : 1,    q : 1, gain : 1 },
                            {cutoff : 0.25, q : 1, gain : 1 },
                            {cutoff : 0.25, q : 1, gain : 1, detune : 100 },
                            {cutoff : 0.01, q : 1, gain : 1, detune : -200 },
                           ];
    createTestAndRun(context, f.LOWPASS, filterParameters);
}

runTest();
successfullyParsed = true;

</script>

<script src="../fast/js/resources/js-test-post.js"></script>
</body>
</html>