setSoundEffectParameter
Client
Changes a parameter of an audio effect that is on, on a sound or a player's voice.
bool setSoundEffectParameter(sound|player target, string effect, string param, float|bool value)
Parameters
| Name | Type | Description |
|---|---|---|
| target | sound|player | A sound, a dui, or a player to change their voice in voice chat. |
| effect | string | The effect's name: chorus, compressor, distortion, echo, flanger, gargle, i3dl2reverb, parameq, reverb or radio. |
| param | string | The name of the effect's parameter (see the list below). |
| value | float|bool | The new value, within the parameter's range. panDelay takes a boolean; integer parameters are truncated. |
Returns
true if the value was applied, false if the target was not found.
Effect parameters
| Effect | Parameters and accepted ranges |
|---|---|
chorus |
wetDryMix 0–100, depth 0–100, feedback -99–99, frequency 0–10, waveform 0–1, delay 0–20, phase 0–4 |
compressor |
gain -60–60, attack 0.01–500, release 50–3000, threshold -60–0, ratio 1–100, predelay |
distortion |
gain -60–0, edge 0–100, postEQCenterFrequency 100–8000, postEQBandwidth 100–8000, preLowpassCutoff 100–8000 |
echo |
wetDryMix 0–100, feedback 0–100, leftDelay, rightDelay, panDelay (bool) |
flanger |
wetDryMix 0–100, depth 0–100, feedback -99–99, frequency 0–10, waveform 0–1, delay 0–4, phase 0–4 |
gargle |
rateHz 1–1000, waveShape 0–1 |
i3dl2reverb |
room, roomHF, roomRolloffFactor, decayTime, decayHFRatio, reflections, reflectionsDelay, reverb, reverbDelay, diffusion, density, HFReference |
parameq |
center 80–16000, bandwidth 1–36, gain -15–15 |
reverb |
inGain -96–0, reverbMix -96–0, reverbTime 0.001–3000, highFreqRTRatio 0.001–0.999 |
radio |
freq_low, freq_hi, fudge 0–20, rm_mod_freq, rm_mix 0–1, o_freq_lo, o_freq_hi |
Example
local music = playSound("sounds/track.mp3", true)
setSoundEffectEnabled(music, "echo", true)
setSoundEffectParameter(music, "echo", "feedback", 30)
setSoundEffectParameter(music, "echo", "panDelay", true)NoteRaises an error if the effect is not on, the parameter does not exist or the value is out of range.