love.audio.setEffect
Available since LÖVE 11.0 |
This function is not supported in earlier versions. |
Defines an effect that can be applied to a Source.
Contents
Function
Synopsis
love.audio.setEffect(name, settings)
Arguments
string name
- The name of the effect.
table settings
- The settings to use for this effect, with the following fields:
Returns
boolean success
- Whether the effect was successfully created.
Available effects and corresponding settings
reverb
number gain
number highgain
number density
number diffusion
number decaytime
number decayhighratio
number earlygain
number earlydelay
number lategain
number latedelay
number roomrolloff
number airabsorption
number highlimit
chorus
distortion
echo
flanger
ringmodulator
compressor
boolean enable
equalizer
number lowgain
number lowcut
number lowmidgain
number lowmidfrequency
number lowmidbandwidth
number highmidgain
number highmidfrequency
number highmidbandwidth
number highgain
number highcut
Examples
Playing music with added reverb
love.audio.setEffect('effect', {type = 'reverb'})
local source = love.audio.newSource('music.ogg', 'stream')
source:setEffect 'effect'
source:play()
Playing music with distortion
love.audio.setEffect('effect', {
type = 'distortion',
gain = .5,
edge = .25,
})
local source = love.audio.newSource('music.ogg', 'stream')
source:setEffect 'effect'
source:play()