hoshimi
    Preparing search index...

    Class FilterManager

    Class representing a filter manager for a player. FilterManager

    Index

    Constructors

    Properties

    bands: EQBandSettings[] = []

    The bands applied to the player.

    data: FilterSettings = ...

    The current filter settings applied to the player.

    The DSPX plugin filters manager.

    filters: EnabledPlayerFilters = ...

    The enabled filters for the player.

    player: Player

    The player this filter manager belongs to.

    The lavalink plugin filters manager.

    Methods

    • Checks if a specific filter is active.

      Parameters

      Returns boolean

      True if the filter is active, false otherwise.

      // Check if the nightcore filter is active
      const isNightcoreActive = player.filterManager.has(FilterType.Nightcore);
      console.log(isNightcoreActive); // true or false
    • Set the distortion filter with the given settings.

      Parameters

      • Optionalsettings: Partial<DistortionSettings> = DefaultFilterPreset.Distortion

        The settings for the distortion filter.

      Returns Promise<FilterManager>

      The instance of the filter manager.

      If the node does not support the distortion filter.

      // Set the distortion filter
      await player.filterManager.setDistortion({ sinOffset: 0.5, sinScale: 2.0 });
    • Set the karaoke filter with the given settings.

      Parameters

      • Optionalsettings: Partial<KaraokeSettings> = DefaultFilterPreset.Karaoke

        The settings for the karaoke filter.

      Returns Promise<FilterManager>

      The instance of the filter manager.

      If the node does not support the karaoke filter.

      // Set the karaoke filter
      await player.filterManager.setKaraoke({ level: -15.0, monoLevel: -20.0, filterBand: 220.0, filterWidth: 100.0 });
    • Sets the pitch for the player.

      Parameters

      • pitch: number = 1

        The pitch

      Returns Promise<FilterManager>

      A promise that resolves to the player instance.

      If the node does not support the timescale filter.

      // Set the pitch to 0.8
      await player.filterManager.setPitch(0.8);
    • Sets the rate for the player.

      Parameters

      • rate: number = 1

        The rate to set (default is 1).

      Returns Promise<FilterManager>

      A promise that resolves to the player instance.

      If the node does not support the timescale filter.

      // Set the rate to 1.2
      await player.filterManager.setRate(1.2);
    • Sets the speed for the player.

      Parameters

      • speed: number = 1

        The speed to set (default is 1).

      Returns Promise<FilterManager>

      A promise that resolves to the player instance.

      If the node does not support the timescale filter.

      // Set the speed to 1.5
      await player.filterManager.setSpeed(1.5);
    • Set the tremolo filter with the given settings.

      Parameters

      • Optionalsettings: Partial<TremoloSettings> = DefaultFilterPreset.Tremolo

        The settings for the tremolo filter.

      Returns Promise<FilterManager>

      The instance of the filter manager.

      If the node does not support the tremolo filter.

      // Set the tremolo filter
      await player.filterManager.setTremolo({ frequency: 4.0, depth: 0.5 });
    • Set the vibrato filter with the given settings.

      Parameters

      • Optionalsettings: Partial<TremoloSettings> = DefaultFilterPreset.Vibrato

        The settings for the vibrato filter.

      Returns Promise<FilterManager>

      The instance of the filter manager.

      If the node does not support the vibrato filter.

      // Set the vibrato filter
      await player.filterManager.setVibrato({ frequency: 4.0, depth: 0.5 });
    • Sets the volume for the player.

      Parameters

      • volume: number

        The volume level to set (between 0 and 5).

      Returns Promise<FilterManager>

      A promise that resolves to the player instance.

      If the volume is not a number between 0 and 5.

      // Set the volume to 2.5
      await player.filterManager.setVolume(2.5);