self:update_fx

Client

Updates parameters of an existing audio effect on the audio-2d instance's effect chain


Syntax

local status = self:update_fx(
    name,
    parameters
)

Parameters

TypeNameDescription
stringnameName of the effect to update
tableparametersParameters specific to the effect's type
Only the supplied keys are changed; omitted keys retain their current value

Returns

TypeNameDescription
boolstatustrue on successful update, false otherwise

Examples

Update parameters of an existing effect on an audio-2d instance
local entity = core.audio_2d.create("sounds/ambient.ogg")

entity:add_fx("my_reverb", core.audio_2d.effect.REVERB, {
    room_size = 0.8,
    wet = 0.5,
    dry = 0.5
})

entity:update_fx("my_reverb", {
    wet = 0.9,
    dry = 0.1
})
Update EQ bands on an audio-2d instance
local entity = core.audio_2d.create("sounds/ambient.ogg")

entity:add_fx("my_eq", core.audio_2d.effect.EQ10, {
    bands = { 0.0, 0.0, -3.0, -3.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0 }
})

entity:update_fx("my_eq", {
    bands = { 0.0, 0.0, -6.0, -6.0, 0.0, 0.0, 4.0, 4.0, 0.0, 0.0 }
})

On this page