Filters example

/** Getters */

// Whether any filter is enabled
player.filters.enabled;
// Get all active filters objects
player.filters.active;

/** ------- */


// Sets NightCore filter
player.filters.setTimescale({ pitch: 1.2, rate: 1.1 }, false)
                .setEqualizer([0.2, 0.2], false)
                .setTremolo({ depth: 0.3, frequency: 14 }, false)
                .apply();

/**
 * The `false` param above is to whether to send filter payload to Lavalink or not,
 * if false, you have to use `.apply()` to send it. (default is true)
 * I recommend to use it as false only if you set multiple filters at the same time
 */

// Set Filters (this function will override all active filters)
// Example of NightCore filter
player.filters.set({
    timescale: {
        pitch: 1.2,
        rate: 1.1,
    },
    equalizer: [0.2, 0.18],
    tremolo: {
        depth: 0.3,
        frequency: 14,
    },
});

// Example of 8D filter
player.filters.setRotation({ rotationHz: 0.2 });
// or
player.filters.set({
    rotation: {
        rotationHz: 0.2,
    },
});

/**
 * # Equalizer reference
 * 
 * 15 bands [0-14]
 * 25 Hz, 40 Hz, 63 Hz, 100 Hz, 160 Hz, 250 Hz, 400 Hz, 630 Hz, 1 kHz, 1.6 kHz, 2.5 kHz, 4 kHz, 6.3 kHz, 10 kHz, 16 kHz
 * The meaningful range for the values is -0.25 to 0.5, -0.25 means you're completely wiping out that frequency, 0.25 means you're doubling it
 */

// Example BassBoost
player.filters.setEqualizer([0.29, 0.23, 0.19, 0.16, 0.08]);

// Clears all active filters
player.filters.clear();

Last updated