/** * Base class for all filters. Wraps any WebAudio `AudioNode`, or a chain of them, * so it can be used in `Sound.filters`, `PlayOptions.filters` or `sound.filtersAll`. * Wrap a node directly, or extend this class for a reusable filter. * **Only supported with WebAudio.** * @example * import { filters, sound } from '@pixi/sound'; * const { audioContext } = sound.context; * * // Wrap a single node * const lowpass = audioContext.createBiquadFilter(); * lowpass.frequency.value = 800; * sound.find('music').filters = [new filters.Filter(lowpass)]; * * // Wrap a chain: pass the first node (input) and the last node (output) * const highpass = audioContext.createBiquadFilter(); * const gain = audioContext.createGain(); * highpass.type = 'highpass'; * highpass.connect(gain); * sound.play('music', { filters: [new filters.Filter(highpass, gain)] }); * @memberof filters */ declare class Filter { /** The input node, which the previous filter connects to. */ destination: AudioNode; /** The output node, which connects to the next filter. */ source: AudioNode; /** * @param {AudioNode} destination - The audio node to use as the destination for the input AudioNode * @param {AudioNode} [source] - Optional output node, defaults to destination node. This is useful * when creating filters which contains multiple AudioNode elements chained together. */ constructor(destination: AudioNode, source?: AudioNode); /** Reinitialize */ protected init(destination: AudioNode, source?: AudioNode): void; /** * Connect to the destination. * @param {AudioNode} destination - The destination node to connect the output to */ connect(destination: AudioNode): void; /** Completely disconnect filter from destination and source nodes. */ disconnect(): void; /** Destroy the filter and don't use after this. */ destroy(): void; } export { Filter };