self:add_fx
Client
Adds an audio effect to the audio-3d instance's effect chain
Syntax
local status = self:add_fx(
name,
effect,
parameters = {}
)Parameters
| Type | Name | Description |
|---|---|---|
string | name | Unique name for this effect slot |
core.audio_3d.effect | effect | Effect to instantiate |
table | parameters | Parameters specific to the assigned effect Omitted keys fall back to the engine's default value |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful addition, false otherwise |
Examples
local entity = core.audio_3d.create("sounds/ambient.ogg")
entity:add_fx("my_reverb", core.audio_3d.effect.REVERB, {
room_size = 0.8,
wet = 0.5,
dry = 0.5
})
entity:play()local entity = core.audio_3d.create("sounds/ambient.ogg")
entity:add_fx("my_eq", core.audio_3d.effect.EQ10, {
bands = { 0.0, 0.0, -3.0, -3.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0 }
})
entity:play()