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
Adjusts the player volume (0.0 to 5.0, where 1.0 is 100%).
Array of 15 bands (0-14) with gains from -0.25 to 1.0.
Karaoke settings (vocal removal).
Changes speed, pitch, and rate of the audio.
Adds a wavering effect to the volume.
Adds a wavering effect to the pitch.
Rotates the audio around the stereo channels (8D effect).
Adds distortion/clipping to the audio.
Mixes left/right channels (e.g. mono).
Low-pass filter (muffles high frequencies).
Management
A Set of currently enabled preset/custom filter names.
List of all available built-in and custom defined filters.
Methods
enable(name)
enable(name)#
→thisEnables a pre-defined filter (builtin or custom) by name.
The name of the filter to enable (e.g., "nightcore", "bassboost-high").
player.filters.enable("nightcore");
await player.filters.apply();
disable(name)
disable(name)#
→thisDisables an active filter by name.
The name of the filter to disable.
player.filters.disable("nightcore");
await player.filters.apply();
clear()
Clears ALL active filters and resets the configuration to default.
player.filters.clear();
await player.filters.apply();
apply()
Sends the current filter configuration to the Lavalink node. You must call this after making changes for them to take effect.
player.filters.setTimescale({ speed: 1.2 });
await player.filters.apply();
setEqualizer(bands)
setEqualizer(bands)#
→thisSets custom equalizer bands.
Array of band objects { band: number, gain: number }.
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).
Timescale options.
player.filters.setTimescale({ speed: 1.5, pitch: 1.2 });
await player.filters.apply();
setKaraoke(options)
setKaraoke(options)#
→thisSets the karaoke filter to remove vocals.
Karaoke options.
player.filters.setKaraoke({ level: 1.0, monoLevel: 1.0 });
await player.filters.apply();
setTremolo(options)
setTremolo(options)#
→thisSets the tremolo filter (volume oscillation).
Tremolo options.
player.filters.setTremolo({ frequency: 2.0, depth: 0.5 });
await player.filters.apply();
setVibrato(options)
setVibrato(options)#
→thisSets the vibrato filter (pitch oscillation).
Vibrato options.
player.filters.setVibrato({ frequency: 2.0, depth: 0.5 });
await player.filters.apply();
setRotation(options)
Sets the rotation filter (8D audio effect).
Rotation options.
player.filters.setRotation({ rotationHz: 0.2 });
await player.filters.apply();
setDistortion(options)
Sets the distortion filter.
Distortion options.
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.).
Channel mix options.
player.filters.setChannelMix({ leftToLeft: 1, leftToRight: 0, rightToLeft: 0, rightToRight: 1 });
await player.filters.apply();
setLowPass(options)
setLowPass(options)#
→thisSets the low-pass filter (smoothing).
Low-pass options.
player.filters.setLowPass({ smoothing: 20 });
await player.filters.apply();
setPluginFilters(filters)
Sets custom filters for Lavalink plugins.
Key-value pairs for plugin filters.
player.filters.setPluginFilters({ "my-plugin": { enabled: true } });
await player.filters.apply();