Class
AudioFilter
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#
Bypassboolean | Whether audio streams are passed-through unaffected by this effect.ReadSafe |
FilterTypeAudioFilterType | The curve type of the band represented by the filter.ReadSafe |
Frequencyfloat | The central frequency that the filter acts around.ReadSafe |
Gainfloat | For peaking and shelving filters, controls volume increase or reduction.ReadSafe |
Qfloat | For 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#
| GetConnectedWires | Returns an array of Wires that are connected to the specified
pin. |
| GetGainAt | Returns the magnitude response of the filter at the given frequency. |
| GetInputPins | Gets the list of pins that Wire can use in Wire.TargetName
to connect to this instance via its Wire.TargetInstance property. |
| GetOutputPins | Gets 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.
| Name | Type | Default | Description |
|---|---|---|---|
pin | string | An input or output pin on this instance |
Returns
List<Wire>— An array ofWires
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.
| Name | Type | Default | Description |
|---|---|---|---|
frequency | float | The 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#
| WiringChanged | Fires 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.
| Name | Type | Default | Description |
|---|---|---|---|
connected | boolean | Whether the instance got connected or disconnected. | |
pin | string | The pin on the AudioFilter that the Wire targets. | |
wire | Wire | The Wire between the AudioFilter and the other
instance. | |
instance | Instance | The other instance that is or was connected through the Wire. |
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild