- Documentation
- Client functions
- setSoundEffectEnabled
Function
setSoundEffectEnabled
Turns an effect on or off for a sound from playSound/playSound3D. Available effects: chorus, compressor, distortion, echo, flanger, gargle, i3dl2reverb, parameq, reverb (as in MTA) and bandpass (a pass band, e.g. a voice over the phone).
Syntax
bool setSoundEffectEnabled(sound theSound, string effectName, bool enable)Arguments
theSoundsound- The sound.
effectNamestring- The effect name.
enablebooltrue= on.
Returns
true on success.
Example
local music = playSound("audio/radio.mp3", true)
setSoundEffectEnabled(music, "echo", true)
setSoundEffectParameter(music, "echo", "leftDelay", 300)
Notes
The first effect turned on moves the sound to the effects mixer at the same play position (MP3 and WAV up to 10 minutes).
See also
getSoundEffectsReturns a table of all of a sound's effects: effect name →true/false.setSoundEffectParameterSets a parameter of an effect, even one that is off. Names and ranges are as in MTA (e.g.echo:wetDryMix,feedback,leftDelay,rightDelay,panDelay;reverb:inGain,reverbMix,reverbTime,highFreqRTRatio);bandpass:lowCut,highCut,gain.getSoundEffectParametersReturns an effect's current parameters: name → value.