> For the complete documentation index, see [llms.txt](https://vulkava.js.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vulkava.js.org/docs/filters.md).

# Filters

Represents a filter structure for one Player

{% hint style="warning" %}
Adding a filter can have adverse effects on lavalink performance. These filters force Lavaplayer to decode all audio to PCM, even if the input was already in the Opus format that Discord uses. This means decoding and encoding audio that would normally require very little processing. This is often the case with YouTube videos.
{% endhint %}

### Properties

| Name    |              Description             |                                                                                                Type |
| ------- | :----------------------------------: | --------------------------------------------------------------------------------------------------: |
| enabled |   Checks if some filter is enabled   | [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) |
| active  | Gets a copy of active filters object |                                                         [FilterOptions](/typedefs/filteroptions.md) |

### Methods

#### apply()

Sends the filter payload to Lavalink Node applying all active filters

#### clear()

Clears all active filters

#### set()

Sets the filters (this function will override all active filters)

| Property |                                 Description |
| -------- | ------------------------------------------: |
| options  | [FilterOptions](/typedefs/filteroptions.md) |

#### setChannelMix()

Configs the channel mix filter

| Property |                                                                                                                                                                                                                                                              Description |                                                                                                                                                     |
| -------- | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| options  |                                                                                                                                                                                          <p><a href="/typedefs/filteroptions.md#channelmixoptions">ChannelMixOptions</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null">null</a><br>The filter options, null to disable</p> |
| apply    | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a> (optional)<br>Whether to send filter payload to Lavalink or not, default is true.<br>Set it to false if you set multiple filters at the same time </p> |                                                                                                                                                     |

| Returns                     |                       Description |
| --------------------------- | --------------------------------: |
| [Filters](/docs/filters.md) | This instance, for chaining calls |

#### setDistortion()

Configs the distortion filter

| Property |                                                                                                                                                                                                                                                              Description |                                                                                                                                                     |
| -------- | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| options  |                                                                                                                                                                                          <p><a href="/typedefs/filteroptions.md#distortionoptions">DistortionOptions</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null">null</a><br>The filter options, null to disable</p> |
| apply    | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a> (optional)<br>Whether to send filter payload to Lavalink or not, default is true.<br>Set it to false if you set multiple filters at the same time </p> |                                                                                                                                                     |

| Returns                     |                       Description |
| --------------------------- | --------------------------------: |
| [Filters](/docs/filters.md) | This instance, for chaining calls |

#### setEqualizer()

Configs the equalizer filter. [Learn more](/typedefs/filteroptions.md#equalizer-bands-frequencies)

| Property |                                                                                                                                                                                                                                                              Description |                                                                                                                                                             |
| -------- | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| options  |                                              <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a>> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null">null</a><br>An array of the band gains, null to disable</p> |
| apply    | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a> (optional)<br>Whether to send filter payload to Lavalink or not, default is true.<br>Set it to false if you set multiple filters at the same time </p> |                                                                                                                                                             |

| Returns                     |                       Description |
| --------------------------- | --------------------------------: |
| [Filters](/docs/filters.md) | This instance, for chaining calls |

#### setKaraoke()

Configs the karaoke filter

| Property |                                                                                                                                                                                                                                                              Description |                                                                                                                                                     |
| -------- | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| options  |                                                                                                                                                                                                <p><a href="/typedefs/filteroptions.md#karaokeoptions">KaraokeOptions</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null">null</a><br>The filter options, null to disable</p> |
| apply    | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a> (optional)<br>Whether to send filter payload to Lavalink or not, default is true.<br>Set it to false if you set multiple filters at the same time </p> |                                                                                                                                                     |

| Returns                     |                       Description |
| --------------------------- | --------------------------------: |
| [Filters](/docs/filters.md) | This instance, for chaining calls |

#### setLowPass()

Configs the low pass filter

| Property |                                                                                                                                                                                                                                                              Description |                                                                                                                                                     |
| -------- | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| options  |                                                                                                                                                                                                <p><a href="/typedefs/filteroptions.md#lowpassoptions">LowPassOptions</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null">null</a><br>The filter options, null to disable</p> |
| apply    | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a> (optional)<br>Whether to send filter payload to Lavalink or not, default is true.<br>Set it to false if you set multiple filters at the same time </p> |                                                                                                                                                     |

| Returns                     |                       Description |
| --------------------------- | --------------------------------: |
| [Filters](/docs/filters.md) | This instance, for chaining calls |

#### setRotation()

Configs the rotation filter

| Property |                                                                                                                                                                                                                                                              Description |                                                                                                                                                     |
| -------- | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| options  |                                                                                                                                                                                              <p><a href="/typedefs/filteroptions.md#rotationoptions">RotationOptions</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null">null</a><br>The filter options, null to disable</p> |
| apply    | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a> (optional)<br>Whether to send filter payload to Lavalink or not, default is true.<br>Set it to false if you set multiple filters at the same time </p> |                                                                                                                                                     |

| Returns                     |                       Description |
| --------------------------- | --------------------------------: |
| [Filters](/docs/filters.md) | This instance, for chaining calls |

#### setTimescale()

Configs the timescale filter

| Property |                                                                                                                                                                                                                                                              Description |                                                                                                                                                     |
| -------- | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| options  |                                                                                                                                                                                            <p><a href="/typedefs/filteroptions.md#timescaleoptions">TimescaleOptions</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null">null</a><br>The filter options, null to disable</p> |
| apply    | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a> (optional)<br>Whether to send filter payload to Lavalink or not, default is true.<br>Set it to false if you set multiple filters at the same time </p> |                                                                                                                                                     |

| Returns                     |                       Description |
| --------------------------- | --------------------------------: |
| [Filters](/docs/filters.md) | This instance, for chaining calls |

#### setTremolo()

Configs the tremolo filter

| Property |                                                                                                                                                                                                                                                              Description |                                                                                                                                                     |
| -------- | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| options  |                                                                                                                                                                                                <p><a href="/typedefs/filteroptions.md#tremolooptions">TremoloOptions</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null">null</a><br>The filter options, null to disable</p> |
| apply    | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a> (optional)<br>Whether to send filter payload to Lavalink or not, default is true.<br>Set it to false if you set multiple filters at the same time </p> |                                                                                                                                                     |

| Returns                     |                       Description |
| --------------------------- | --------------------------------: |
| [Filters](/docs/filters.md) | This instance, for chaining calls |

#### setVolume()

| Property |                                                                                                                                                                                                                                                              Description |
| -------- | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| volume   |                                                                                                        <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a><br>The volume between 0-500<br>Default is 100</p> |
| apply    | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a> (optional)<br>Whether to send filter payload to Lavalink or not, default is true.<br>Set it to false if you set multiple filters at the same time </p> |

| Returns                     |                       Description |
| --------------------------- | --------------------------------: |
| [Filters](/docs/filters.md) | This instance, for chaining calls |

#### setVibrato()

Configs the vibrato filter

| Property |                                                                                                                                                                                                                                                              Description |                                                                                                                                                     |
| -------- | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| options  |                                                                                                                                                                                                <p><a href="/typedefs/filteroptions.md#vibratooptions">VibratoOptions</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null">null</a><br>The filter options, null to disable</p> |
| apply    | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a> (optional)<br>Whether to send filter payload to Lavalink or not, default is true.<br>Set it to false if you set multiple filters at the same time </p> |                                                                                                                                                     |

| Returns                     |                       Description |
| --------------------------- | --------------------------------: |
| [Filters](/docs/filters.md) | This instance, for chaining calls |
