{{newin|[[11.0]]|110|type=function}}
Defines an effect that can be applied to a [[Source]].

Not all system supports audio effects. Use [[love.audio.isEffectsSupported]] to check.

== Function ==
=== Synopsis ===
<source lang="lua">
love.audio.setEffect(name, settings)
</source>
=== Arguments ===
{{param|string|name|The name of the effect.}}
{{param|table|settings|The settings to use for this effect, with the following fields:}}
{{subparam|EffectType|type|The type of effect to use.}}
{{subparam|number|volume|The volume of the effect.}}
{{subparam|number|...|Effect-specific settings. See [[EffectType]] for available effects and their corresponding settings.}}
=== Returns ===
{{param|boolean|success|Whether the effect was successfully created.}}

== Function ==
=== Synopsis ===
<source lang="lua">
love.audio.setEffect(name, enabled)
</source>
=== Arguments ===
{{param|string|name|The name of the effect.}}
{{param|boolean|enabled (true)|If false and the given effect name was previously set, disables the effect.}}
=== Returns ===
{{param|boolean|success|Whether the effect was successfully disabled.}}

== Examples ==
=== Playing music with added reverb ===
<source lang="lua">
love.audio.setEffect('myEffect', {type = 'reverb'})
local source = love.audio.newSource('music.ogg', 'stream')
source:setEffect('myEffect')
source:play()
</source>

=== Playing music with distortion ===
<source lang="lua">
love.audio.setEffect('myEffect', {
	type = 'distortion',
	gain = .5,
	edge = .25,
})
local source = love.audio.newSource('music.ogg', 'stream')
source:setEffect('myEffect')
source:play()
</source>

== See Also ==
* [[parent::love.audio]]
* [[love.audio.isEffectsSupported]]
* [[Source:setEffect]]

[[Category:Functions]]
{{#set:Description=Defines an effect that can be applied to a Source.}}

== Other Languages ==
{{i18n|love.audio.setEffect}}