Roblox UtilitiesDevlHub Roblox Documentation

Class

AudioFilter

Inherits
Instance › Object
Memory category
Internal

Adjusts the frequency content of audio streams.

AudioFilter adjusts the frequency content of audio streams. It provides one Input pin and one Output pin which can be connected to/from by Wires. AudioFilter uses its FilterType, Gain, and Q properties to determine what to do around a particular cutoff Frequency.

Properties 5#

BypassbooleanWhether audio streams are passed-through unaffected by this effect.ReadSafe
FilterTypeAudioFilterTypeThe curve type of the band represented by the filter.ReadSafe
FrequencyfloatThe central frequency that the filter acts around.ReadSafe
GainfloatFor peaking and shelving filters, controls volume increase or reduction.ReadSafe
QfloatFor peaking, lowpass, highpass, bandpass, and notch filters, controls the selectiveness or resonance.ReadSafe

Bypass: boolean#

ReadSafe

If true, audio streams are passed-through unaffected by this effect.

FilterType: AudioFilterType#

ReadSafe

The type of frequency response curve that will be used to filter the audio signal. Each type of curve affects the frequency content of the audio in different ways.

Frequency: float#

ReadSafe

The central frequency in hertz of the curve represented by the filter. Generally, adjusting this value up or down corresponds to a horizontal shift in the overall frequency curve. Ranges from 20 to 22000.

Gain: float#

ReadSafe

The gain value in decibels used to determine the volume level of the curve represented by the filter. Only applies when the FilterType is Peak, LowShelf, or HighShelf. Ranges from -30 to 30.

Q: float#

ReadSafe

The quality value used to determine the slope or resonance of the curve represented by the filter. Only applies when the FilterType is Peak, Lowpass[x]dB, Highpass[x]dB, Bandpass, or Notch. Ranges from 0.1 to 10.

For FilterType values of Lowpass12dB and Highpass12dB, a Q value of sqrt(2) / 2, or 0.707, corresponds to a flat filter at a 12dB/octave slope.

Methods 4#

GetConnectedWiresReturns an array of Wires that are connected to the specified pin.
GetGainAtReturns the magnitude response of the filter at the given frequency.
GetInputPinsGets the list of pins that Wire can use in Wire.TargetName to connect to this instance via its Wire.TargetInstance property.
GetOutputPinsGets the list of pins that Wire can use in Wire.SourceName to connect to this instance via its Wire.SourceInstance property.

GetConnectedWires(pin: string): List<Wire>#

Returns an array of Wires that are connected to the specified pin. AudioFilter has one "Input" pin and one "Output" pin.

NameTypeDefaultDescription
pinstringAn input or output pin on this instance
Returns
  • List<Wire> — An array of Wires

GetGainAt(frequency: float): float#

Returns the gain value, in decibels, of the frequency response curve represented by the filter at the given frequency, in hertz. This can be used to sample the exact shape of the filter in key places or as a whole.

NameTypeDefaultDescription
frequencyfloatThe frequency, in hertz, to sample.
Returns
  • float — The gain value, in decibels, at the given frequency.

GetInputPins(): Array#

Gets the list of pins that Wire can use in Wire.TargetName to connect to this instance via its Wire.TargetInstance property.

For AudioFilter, this is Input only.

Returns
  • Array — An array of strings representing valid pin names.

GetOutputPins(): Array#

Gets the list of pins that Wire can use in Wire.SourceName to connect to this instance via its Wire.SourceInstance property.

For AudioFilter, this is Output only.

Returns
  • Array — An array of strings representing valid pin names.

Events 1#

WiringChangedFires when another instance is connected to or disconnected from the AudioFilter via a Wire.

WiringChanged(connected: boolean, pin: string, wire: Wire, instance: Instance)#

Event that fires after a Wire becomes connected or disconnected, and that Wire is now or was previously connected to a pin on the AudioFilter and to some other wirable instance.

NameTypeDefaultDescription
connectedbooleanWhether the instance got connected or disconnected.
pinstringThe pin on the AudioFilter that the Wire targets.
wireWireThe Wire between the AudioFilter and the other instance.
instanceInstanceThe other instance that is or was connected through the Wire.

Inherited members#

Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed