- Documentation
- Client functions
- setSoundEffectParameter
Function
setSoundEffectParameter
Sets 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.
Syntax
bool setSoundEffectParameter(sound theSound, string effectName, string effectParameter, mixed effectParameterValue)Arguments
theSoundsound- The sound.
effectNamestring- The effect name.
effectParameterstring- The parameter name.
effectParameterValuemixed- A number (or a
boolforpanDelay). A value out of range givesfalseand a warning with the range.
Returns
true on success.
Example
A voice over the phone.
local call = playSound("audio/call.mp3")
setSoundEffectEnabled(call, "bandpass", true)
setSoundEffectParameter(call, "bandpass", "lowCut", 400)
setSoundEffectParameter(call, "bandpass", "highCut", 3000)
See also
setSoundEffectEnabledTurns an effect on or off for a sound fromplaySound/playSound3D. Available effects:chorus,compressor,distortion,echo,flanger,gargle,i3dl2reverb,parameq,reverb(as in MTA) andbandpass(a pass band, e.g. a voice over the phone).getSoundEffectParametersReturns an effect's current parameters: name → value.