UNPKG

1.93 kBTypeScriptView Raw
1import { Gain } from "../../core/context/Gain.js";
2import { Param } from "../../core/context/Param.js";
3import { ToneAudioNodeOptions } from "../../core/context/ToneAudioNode.js";
4import { NormalRange, Time } from "../../core/type/Units.js";
5import { RecursivePartial } from "../../core/util/Interface.js";
6import { ToneAudioWorklet } from "../../core/worklet/ToneAudioWorklet.js";
7export interface FeedbackCombFilterOptions extends ToneAudioNodeOptions {
8 delayTime: Time;
9 resonance: NormalRange;
10}
11/**
12 * Comb filters are basic building blocks for physical modeling. Read more
13 * about comb filters on [CCRMA's website](https://ccrma.stanford.edu/~jos/pasp/Feedback_Comb_Filters.html).
14 *
15 * This comb filter is implemented with the AudioWorkletNode which allows it to have feedback delays less than the
16 * Web Audio processing block of 128 samples. There is a polyfill for browsers that don't yet support the
17 * AudioWorkletNode, but it will add some latency and have slower performance than the AudioWorkletNode.
18 * @category Component
19 */
20export declare class FeedbackCombFilter extends ToneAudioWorklet<FeedbackCombFilterOptions> {
21 readonly name = "FeedbackCombFilter";
22 /**
23 * The amount of delay of the comb filter.
24 */
25 readonly delayTime: Param<"time">;
26 /**
27 * The amount of feedback of the delayed signal.
28 */
29 readonly resonance: Param<"normalRange">;
30 readonly input: Gain;
31 readonly output: Gain;
32 /**
33 * @param delayTime The delay time of the filter.
34 * @param resonance The amount of feedback the filter has.
35 */
36 constructor(delayTime?: Time, resonance?: NormalRange);
37 constructor(options?: RecursivePartial<FeedbackCombFilterOptions>);
38 protected _audioWorkletName(): string;
39 /**
40 * The default parameters
41 */
42 static getDefaults(): FeedbackCombFilterOptions;
43 onReady(node: AudioWorkletNode): void;
44 dispose(): this;
45}