1 | import { Gain } from "../../core/context/Gain.js";
|
2 | import { ToneAudioNode } from "../../core/context/ToneAudioNode.js";
|
3 | import { Frequency } from "../../core/type/Units.js";
|
4 | import { Signal } from "../../signal/Signal.js";
|
5 | import { BiquadFilterOptions } from "./BiquadFilter.js";
|
6 | export type FilterRollOff = -12 | -24 | -48 | -96;
|
7 | export type FilterOptions = BiquadFilterOptions & {
|
8 | rolloff: FilterRollOff;
|
9 | };
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | export declare class Filter extends ToneAudioNode<FilterOptions> {
|
22 | readonly name: string;
|
23 | readonly input: Gain<"gain">;
|
24 | readonly output: Gain<"gain">;
|
25 | private _filters;
|
26 | |
27 |
|
28 |
|
29 | private _rolloff;
|
30 | private _type;
|
31 | |
32 |
|
33 |
|
34 | readonly Q: Signal<"positive">;
|
35 | |
36 |
|
37 |
|
38 | readonly frequency: Signal<"frequency">;
|
39 | |
40 |
|
41 |
|
42 | readonly detune: Signal<"cents">;
|
43 | |
44 |
|
45 |
|
46 | readonly gain: Signal<"decibels">;
|
47 | |
48 |
|
49 |
|
50 |
|
51 |
|
52 | constructor(frequency?: Frequency, type?: BiquadFilterType, rolloff?: FilterRollOff);
|
53 | constructor(options?: Partial<FilterOptions>);
|
54 | static getDefaults(): FilterOptions;
|
55 | /**
|
56 | * The type of the filter. Types: "lowpass", "highpass",
|
57 | * "bandpass", "lowshelf", "highshelf", "notch", "allpass", or "peaking".
|
58 | */
|
59 | get type(): BiquadFilterType;
|
60 | set type(type: BiquadFilterType);
|
61 | /**
|
62 | * The rolloff of the filter which is the drop in db
|
63 | * per octave. Implemented internally by cascading filters.
|
64 | * Only accepts the values -12, -24, -48 and -96.
|
65 | */
|
66 | get rolloff(): FilterRollOff;
|
67 | set rolloff(rolloff: FilterRollOff);
|
68 | /**
|
69 | * Get the frequency response curve. This curve represents how the filter
|
70 | * responses to frequencies between 20hz-20khz.
|
71 | * @param len The number of values to return
|
72 | * @return The frequency response curve between 20-20kHz
|
73 | */
|
74 | getFrequencyResponse(len?: number): Float32Array;
|
75 | /**
|
76 | * Clean up.
|
77 | */
|
78 | dispose(): this;
|
79 | }
|