SetSoundEffectParameter: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
Eznemgergo (talk | contribs) m (Clarified using method) |
||
(9 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
{{ | {{Added feature/item|1.5.9|1.5.8|20914|This function sets the parameter of a [[sound]] effect.}} | ||
{{Note|Using this function on a player voice sound element is not supported at this time.}} | {{Note|Using this function on a player voice sound element is not supported at this time.}} | ||
Line 8: | Line 8: | ||
{{OOP||[[sound]]:setEffectParameter}} | {{OOP||[[sound]]:setEffectParameter}} | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''sound''' | *'''sound:''' The [[sound]] element. | ||
*'''effectName''' | *'''effectName:''' The name of the effect whose parameter you want to change: | ||
{{Sound_Effects}} | {{Sound_Effects}} | ||
*'''effectParam''' | *'''effectParam:''' The parameter [[#Effects Parameters|name]]. | ||
*'''paramValue''' | *'''paramValue:''' The parameter [[#Effects Parameters|value]]. | ||
===Returns=== | ===Returns=== | ||
Returns | Returns ''true'' if effect have been set successfully, ''false'' otherwise. | ||
===Effects Parameters=== | ===Effects Parameters=== | ||
{{Sound_Effects_Parameters}} | {{Sound_Effects_Parameters}} | ||
== | ==Example== | ||
NOTE: This function will only work if it's executed within a timer. | |||
<syntaxhighlight lang="lua"> | |||
--An example via a timer | |||
local mySound = playSound("discoSound.mp3", 0, 0, 10) | |||
setSoundEffectEnabled(mySound, "echo", true) | |||
setTimer(function() | |||
setSoundEffectParameter(mySound, "echo", "wetDryMix", 80) | |||
end, 1, 1) | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
setSoundEffectParameter(sound, "echo", " | local sound = playSound3D ("music.mp3", 0, 0, 10) | ||
setSoundEffectEnabled (sound, "echo", true) | |||
setSoundEffectParameter (sound, "echo", "wetDryMix", 80) | |||
setSoundEffectParameter (sound, "echo", "feedback", 30) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Client_audio_functions}} | {{Client_audio_functions}} |
Latest revision as of 14:25, 8 March 2025
This function sets the parameter of a sound effect.
Syntax
bool setSoundEffectParameter ( element sound, string effectName, string effectParam, var paramValue )
OOP Syntax Help! I don't understand this!
- Method: sound:setEffectParameter(...)
Required Arguments
- sound: The sound element.
- effectName: The name of the effect whose parameter you want to change:
- gargle
- compressor
- echo
- i3dl2reverb
- distortion
- chorus
- parameq
- reverb
- flanger
Returns
Returns true if effect have been set successfully, false otherwise.
Effects Parameters
ExpandChorus |
---|
ExpandCompressor |
---|
ExpandDistortion |
---|
ExpandEcho |
---|
ExpandFlanger |
---|
ExpandGargle |
---|
ExpandI3DL2 Reverb |
---|
ExpandParametric Equalizer |
---|
ExpandReverb |
---|
Example
NOTE: This function will only work if it's executed within a timer.
--An example via a timer local mySound = playSound("discoSound.mp3", 0, 0, 10) setSoundEffectEnabled(mySound, "echo", true) setTimer(function() setSoundEffectParameter(mySound, "echo", "wetDryMix", 80) end, 1, 1)
local sound = playSound3D ("music.mp3", 0, 0, 10) setSoundEffectEnabled (sound, "echo", true) setSoundEffectParameter (sound, "echo", "wetDryMix", 80) setSoundEffectParameter (sound, "echo", "feedback", 30)
See Also
- getRadioChannel
- getRadioChannelName
- getSFXStatus
- getSoundBPM
- getSoundBufferLength
- getSoundEffectParameters
- getSoundEffects
- getSoundFFTData
- getSoundLength
- getSoundLevelData
- getSoundMaxDistance
- getSoundMetaTags
- getSoundMinDistance
- getSoundPan
- getSoundPosition
- getSoundProperties
- getSoundSpeed
- getSoundVolume
- getSoundWaveData
- isSoundLooped
- isSoundPanningEnabled
- isSoundPaused
- playSFX3D
- playSFX
- playSound3D
- playSound
- setRadioChannel
- setSoundEffectEnabled
- setSoundEffectParameter
- setSoundLooped
- setSoundMaxDistance
- setSoundMinDistance
- setSoundPan
- setSoundPanningEnabled
- setSoundPaused
- setSoundPosition
- setSoundProperties
- setSoundSpeed
- setSoundVolume
- stopSound
- Shared
- playSoundFrontEnd