export class FilterEffect {
    input;
    output;
    constructor(context, type = "lowpass") {
        this.input = context.createBiquadFilter();
        this.input.type = type;
        this.output = this.input;
    }
    setFrequency(value) {
        if (!Number.isFinite(value) || value <= 0) {
            throw new Error("Filter frequency must be positive");
        }
        this.input.frequency.value = value;
    }
    setQ(value) {
        if (!Number.isFinite(value) || value < 0) {
            throw new Error("Filter Q must be non-negative");
        }
        this.input.Q.value = value;
    }
    connect(destination) {
        return this.output.connect(destination);
    }
    disconnect() {
        this.output.disconnect();
    }
    dispose() {
        this.disconnect();
    }
}
//# sourceMappingURL=Filter.js.map