Skip to main content
Version: v2.8.5

Class : Filters

Constructor

new Magmastream.Filters(player: Player)
Parameter Type Description Optional
playerPlayerThe guild player.

Table of contents

Properties Methods
distortionbassBoost()
equalizerchina()
karaokechipmunk()
playerclearFilters()
rotationdarthvader()
timescaledaycore()
vibratodemon()
reverbdistort()
volumedoubletime()
filterStatusearrape()
bassBoostLeveleightD()
electronic()
getFilterStatus()
nightcore()
party()
pop()
radio()
setDistortion()
setEqualizer()
setKaraoke()
setRotation()
setTimescale()
setVibrato()
setVolume()
slowmo()
soft()
tremolo()
trebleBass()
tv()
updateFilters()
vaporwave()

Properties

distortion

Get the distortion filter options

Return: distortionOptions{} | null


equalizer

Get the equalizer filter options

Return: Band[]


karaoke

Get the karaoke filter options

Return: karaokeOptions{} | null


player

The guild player

Return: Player


rotation

Get the rotation filter options

Return: rotationOptions{} | null


timescale

Get the timescale filter options

Return: timescaleOptions{} | null


vibrato

Get the vibrato filter options

Return: vibratoOptions{} | null


reverb

Get the reverb filter options

Return: reverbOptions{} | null


volume

Get the volume the player

Return: number


bassBoostLevel

Get the bassBoostLevel filter level

Return: number


filtersStatus

Get the filters status

Return: number

Methods

bassBoost(stage)

async function

Sets the bass boost level on the audio.

This method scales the gain of a predefined equalizer curve to the specified level. The curve is designed to emphasize or reduce low frequencies, creating a bass-heavy or bass-reduced effect.

Return: Promise<this>

Parameter Type Description Optional
stagenumberThe level of bass boost to apply. The value ranges from -3 to 3, where negative values reduce bass, 0 disables the effect, and positive values increase bass.

china(status)

async function

Toggles the "China" effect on the audio.

This method applies or removes a filter that reduces the pitch of the audio by half, changing the speed or rate. This creates a "hollow" or "echoey" sound.

Return: Promise<this>

Parameter Type Description Optional
statusbooleanWhether to enable or disable the china effect.

chipmunk(status)

async function

Toggles the chipmunk effect on the audio.

This method applies or removes a chipmunk effect by adjusting the timescale settings. When enabled, it increases the speed, pitch, and rate of the audio, resulting in a high-pitched, fast playback similar to the sound of a chipmunk.

Return: Promise<this>

Parameter Type Description Optional
statusbooleanWhether to enable or disable the chipmunk effect.

clearFilters()

async function

Clears all filters applied to the audio.

This method resets all filter settings to their default values and removes any active filters from the player.

Return: Promise<this>


darthvader(status)

async function

Toggless a darthvader effect on the audio.

This method applies darthvader effect to audio.

Return: Promise<this>

Parameter Type Description Optional
statusbooleanWhether to enable or disable the darthvader effect.

daycore(status)

async function

Toggles a daycore effect on the audio.

This method applies a daycore effect to audio.

Return: Promise<this>

Parameter Type Description Optional
statusbooleanWhether to enable or disable the daycore effect.

demon(status)

async function

Toggles the demon effect on the audio.

This method applies or removes a demon effect by adjusting the equalizer, timescale, and reverb settings. When enabled, it creates a deeper and more intense sound by lowering the pitch and adding reverb to the audio.

Return: Promise<this>

Parameter Type Description Optional
statusbooleanWhether to enable or disable the daycore effect.

distort(status)

async function

Toggles the distortion effect on the audio.

This method applies or removes a distortion effect by adjusting the distortion settings. When enabled, it adds a rougher, more intense quality to the sound by altering the audio signal to create a more jagged, irregular waveform.

Return: Promise<this>

Parameter Type Description Optional
statusbooleanWhether to enable or disable the distort effect.

doubletime(status)

async function

Toggles a doubletime effect on the audio.

This method applies a doubletime effect to audio.

Return: Promise<this>

Parameter Type Description Optional
statusbooleanWhether to enable or disable the doubletime effect.

earrape(status)

async function

Toggles earrape effect on the audio.

This method applies earrape effect to audio.

Return: Promise<this>

Parameter Type Description Optional
statusbooleanWhether to enable or disable the earrape effect.

eightD(status)

async function

Applies the "8D audio" effect by setting a rotation filter.

This method applies or removes an 8D audio effect by adjusting the rotation settings. When enabled, it creates a sensation of the audio moving around the listener's head, providing an immersive audio experience.

Return: Promise<this>

Parameter Type Description Optional
statusbooleanWhether to enable or disable the eightD effect.

electronic(status)

async function

Toggles electronic effect on the audio.

This method applies electronic effect to audio.

Return: Promise<this>

Parameter Type Description Optional
statusbooleanWhether to enable or disable the eightD effect.

getFilterStatus(filter)

Retrieves the status of a specific filter.

This method returns whether a specific filter is currently applied or not.

Return: boolean

Parameter Type Description Optional
filter AvailableFiltersThe filter to check.

nightcore(status)

async function

Toggles the nightcore effect on the audio.

This method applies or removes a nightcore effect by adjusting the timescale settings. When enabled, it increases the speed and pitch of the audio, giving it a more upbeat and energetic feel.

Return: Promise<this>

Parameter Type Description Optional
statusbooleanWhether to enable or disable the nightcore effect.

party(status)

async function

Toggles a party effect on the audio.

This method applies a party effect to audio.

Return: Promise<this>

Parameter Type Description Optional
statusbooleanWhether to enable or disable the party effect.

pop(status)

async function

Toggles the party effect on the audio.

This method applies or removes a party effect by adjusting the equalizer settings. When enabled, it enhances the bass and treble frequencies, providing a more energetic and lively sound.

Return: Promise<this>

Parameter Type Description Optional
statusbooleanWhether to enable or disable the pop effect.

radio(status)

async function

Toggles radio effect on the audio.

This method applies radio effect to audio.

Return: Promise<this>

Parameter Type Description Optional
statusbooleanWhether to enable or disable the radio effect.

setDistortion(distortion)

async function

Sets the distortion effect on the audio.

This method applies a distortion effect to the audio, which adds a rougher, more intense quality to the sound. The effect is created by altering the audio signal to create a more jagged, irregular waveform.

Return: Promise<this>

Parameter Type Description Optional
distortiondistortionOptions{}The distortion options to apply. If nothing are provided, the distortion is reset.

setEqualizer(bands)

async function

Sets the equalizer on the audio.

This method adjusts the equalization curve of the player's audio output, allowing you to control the frequency response.

Return: Promise<this>

Parameter Type Description Optional
bandsBand[]The equalizer bands to apply (band, gain).

setKaraoke(karaoke)

async function

Sets the karaoke options to the audio.

This method adjusts the audio so that it sounds like a karaoke song, with the original vocals removed. Note that not all songs can be successfully made into karaoke tracks, and some tracks may not sound as good.

Return: Promise<this>

Parameter Type Description Optional
karaokekaraokeOptions{}The karaoke settings to apply (level, mono level, filter band, etc.). If nothing are provided, the karaoke is reset.

setRotation(rotation)

async function

Sets the rotation effect on the audio.

This method applies a rotation effect to the audio, which simulates the sound moving around the listener's head. This effect can create a dynamic and immersive audio experience by altering the directionality of the sound.

Return: Promise<this>

Parameter Type Description Optional
rotationrotationOptions{}The rotation settings (rotationHz). If nothing are provided, the rotation is reset.

setTimescale(timescale)

async function

Sets the timescale of the audio.

This method adjusts the speed and pitch of the audio, allowing you to control the playback speed.

Return: Promise<this>

Parameter Type Description Optional
timescaletimescaleOptions{}The timescale settings to apply (speed, pitch, rate). If nothing are provided, the timescale is reset.

setVibrato(timescale)

async function

Sets the vibrato effect on the audio.

This method applies a vibrato effect to the audio, which adds a wavering, pulsing quality to the sound. The effect is created by rapidly varying the pitch of the audio.

Return: Promise<this>

Parameter Type Description Optional
timescaletimescaleOptions{}The vibrato settings to apply (frequency and depth).

slowmo(status)

async function

Toggles the slowmo effect on the audio.

This method applies or removes a slowmo effect by adjusting the timescale settings. When enabled, it slows down the audio while keeping the pitch the same, giving it a more relaxed and calming feel.

Return: Promise<this>

Parameter Type Description Optional
statusbooleanWhether to enable or disable the status effect.

soft(status)

async function

Applies a soft equalizer effect to the audio.

This method applies or removes a soft equalizer effect by adjusting the equalizer settings. When enabled, it reduces the bass and treble frequencies, giving the audio a softer and more mellow sound.

Return: Promise<this>

Parameter Type Description Optional
statusbooleanWhether to enable or disable the soft effect.

tremolo(status)

async function

Toggles a tremolo effect on the audio.

This method applies a tremolo effect to audio.

Return: Promise<this>

Parameter Type Description Optional
statusbooleanWhether to enable or disable the termolo effect.

trebleBass(status)

async function

Applies the treble/bass equalizer effect to the audio.

This method applies or removes a treble/bass equalizer effect by adjusting the equalizer settings. When enabled, it enhances the treble and bass frequencies, giving the audio a more balanced sound.

Return: Promise<this>

Parameter Type Description Optional
statusbooleanWhether to enable or disable the treble bass effect.

tv(status)

async function

Toggles the TV equalizer effect on the audio.

This method applies or removes a TV equalizer effect by adjusting the equalizer settings. When enabled, it enhances specific frequency bands to mimic the audio characteristics typically found in television audio outputs.

Return: Promise<this>

Parameter Type Description Optional
statusbooleanWhether to enable or disable the tv effect.

updateFilters()

async function

Updates the player's audio filters.

This method sends a request to the player's node to update the filter settings based on the current properties of the Filters instance. The filters include distortion, equalizer, karaoke, rotation, timescale, vibrato, and volume. Once the request is sent, it ensures that the player's audio output reflects the changes in filter settings.

Return: Promise<this>


vaporwave(status)

async function

Applies the vaporwave effect by adjusting the equalizer and pitch.

This method applies or removes a vaporwave effect by adjusting the equalizer settings. When enabled, it gives the audio a dreamy and nostalgic feel, characteristic of the vaporwave genre.

Return: Promise<this>

Parameter Type Description Optional
statusbooleanWhether to enable or disable the vaporwave effect.