Star ✨ on GitHub

Filters

Manages audio effects for the player, including equalization, timescale, karaoke, and more.

The Filters class allows you to apply audio effects to the player's output. You can use built-in presets (like "nightcore" or "bassboost") or manually configure specific filters like the equalizer or timescale.

Properties

Filter Properties

Direct access to filter configuration objects.

Standard Filters

volumenumber | undefined

Adjusts the player volume (0.0 to 5.0, where 1.0 is 100%).

equalizerIEqualizerBand[] | undefined

Array of 15 bands (0-14) with gains from -0.25 to 1.0.

karaokeIKaraoke | undefined

Karaoke settings (vocal removal).

timescaleITimescale | undefined

Changes speed, pitch, and rate of the audio.

tremoloITremolo | undefined

Adds a wavering effect to the volume.

vibratoIVibrato | undefined

Adds a wavering effect to the pitch.

rotationIRotation | undefined

Rotates the audio around the stereo channels (8D effect).

distortionIDistortion | undefined

Adds distortion/clipping to the audio.

channelMixIChannelMix | undefined

Mixes left/right channels (e.g. mono).

lowPassILowPass | undefined

Low-pass filter (muffles high frequencies).

Management

activeSet<string>

A Set of currently enabled preset/custom filter names.

availablestring[]

List of all available built-in and custom defined filters.

Methods

enable(name)

Enables a pre-defined filter (builtin or custom) by name.

namestring required

The name of the filter to enable (e.g., "nightcore", "bassboost-high").

Example
player.filters.enable("nightcore");
await player.filters.apply();

disable(name)

Disables an active filter by name.

namestring required

The name of the filter to disable.

Example
player.filters.disable("nightcore");
await player.filters.apply();

clear()

clear()#

Clears ALL active filters and resets the configuration to default.

Example
player.filters.clear();
await player.filters.apply();

apply()

apply()#

Sends the current filter configuration to the Lavalink node. You must call this after making changes for them to take effect.

Example
player.filters.setTimescale({ speed: 1.2 });
await player.filters.apply();

setEqualizer(bands)

Sets custom equalizer bands.

bandsIEqualizerBand[] required

Array of band objects { band: number, gain: number }.

Example
player.filters.setEqualizer([
    { band: 0, gain: 0.2 },
    { band: 1, gain: 0.15 }
]);
await player.filters.apply();

setTimescale(options)

Sets the timescale filter (speed, pitch, rate).

optionsITimescale

Timescale options.

Example
player.filters.setTimescale({ speed: 1.5, pitch: 1.2 });
await player.filters.apply();

setKaraoke(options)

Sets the karaoke filter to remove vocals.

optionsIKaraoke

Karaoke options.

Example
player.filters.setKaraoke({ level: 1.0, monoLevel: 1.0 });
await player.filters.apply();

setTremolo(options)

Sets the tremolo filter (volume oscillation).

optionsITremolo

Tremolo options.

Example
player.filters.setTremolo({ frequency: 2.0, depth: 0.5 });
await player.filters.apply();

setVibrato(options)

Sets the vibrato filter (pitch oscillation).

optionsIVibrato

Vibrato options.

Example
player.filters.setVibrato({ frequency: 2.0, depth: 0.5 });
await player.filters.apply();

setRotation(options)

Sets the rotation filter (8D audio effect).

optionsIRotation

Rotation options.

Example
player.filters.setRotation({ rotationHz: 0.2 });
await player.filters.apply();

setDistortion(options)

Sets the distortion filter.

optionsIDistortion

Distortion options.

Example
player.filters.setDistortion({ sinOffset: 0, sinScale: 1, cosOffset: 0, cosScale: 1, tanOffset: 0, tanScale: 1, offset: 0, scale: 1 });
await player.filters.apply();

setChannelMix(options)

Sets the channel mix filter (mono, left-only, etc.).

optionsIChannelMix

Channel mix options.

Example
player.filters.setChannelMix({ leftToLeft: 1, leftToRight: 0, rightToLeft: 0, rightToRight: 1 });
await player.filters.apply();

setLowPass(options)

Sets the low-pass filter (smoothing).

optionsILowPass

Low-pass options.

Example
player.filters.setLowPass({ smoothing: 20 });
await player.filters.apply();

setPluginFilters(filters)

Sets custom filters for Lavalink plugins.

filtersRecord<string, any> required

Key-value pairs for plugin filters.

Example
player.filters.setPluginFilters({ "my-plugin": { enabled: true } });
await player.filters.apply();