DSP Effect API

Contents

DSP Effect API#

FmodDSP#

Inherits: RefCounted

Low-level wrapper around FMOD::DSP for signal processing and effect chains

Description#

FmodDSP represents FMOD DSP. can FMOD effect, can FmodAudioEffect creates and to bus or ChannelControl DSP. through can controls DSP state, bypass state, parameter, input output connection, callback.

Properties#

Type

Name

Default

Description

bool

active

false

DSP state.

bool

bypass

false

DSP bypass.

Methods#

Connection routing.#

FmodDSPConnection add_input(target_dsp: FmodDSP, type: FmodDSPConnectionType = DSPCONNECTION_TYPE_STANDARD)#

target_dsp as input connection to current DSP, and returns connection object.

Dictionary get_input(index: int) const#

Returns information for the specified input connection, usually including the input DSP and connection object.

Dictionary get_output(index: int) const#

Returns information for the specified output connection, usually including the output DSP and connection object.

int get_num_inputs() const#

Returns input connection.

int get_num_outputs() const#

Returns output connection.

void disconnect_from(target: FmodDSP, connection: FmodDSPConnection = null)#

Disconnects to specified DSP connection. connection object when connection.

void disconnect_all(inputs: bool, outputs: bool)#

Input and / or output connection.

Channel Format and Metering#

void set_channel_format(numchannels: int, speakermode: int)#

Sets the DSP output channel count and speaker mode.

Dictionary get_channel_format() const#

Returns DSP current channel.

Dictionary get_output_channel_format(inchannels: int, inspeakermode: int) const#

Input channel queries DSP output channel.

void set_metering_enabled(input_enabled: bool, output_enabled: bool)#

Or DSP input / output.

Dictionary get_metering_enabled() const#

Returns input and output.

Dictionary get_metering_info() const#

Returns suitable for volume or.

Parameter controls.#

int get_num_parameters() const#

Returns DSP parameter.

Dictionary get_parameter_info(index: int) const#

Returns information for the specified parameter, including name, label, description, type, range, and default value.

int get_data_parameter_index(data_type: FmodDSPParameterDataType) const#

FMOD parameter parameter index.

Methods

Description

set_parameter_float(index, value) / get_parameter_float(index)

Sets or gets parameter.

set_parameter_int(index, value) / get_parameter_int(index)

Sets or gets parameter.

set_parameter_bool(index, value) / get_parameter_bool(index)

Sets or gets parameter.

set_parameter_data(index, data) / get_parameter_data(index)

Sets or gets parameter.

State and Information#

void set_active(active: bool)#

Sets DSP state.

bool get_active() const#

Returns DSP.

void set_bypass(bypass: bool)#

Sets DSP bypass state.

bool get_bypass() const#

Returns DSP bypass.

void set_wet_dry_mix(prewet: float, postwet: float, dry: float)#

Sets DSP /.

Dictionary get_wet_dry_mix() const#

Returns / sets.

bool get_idle() const#

Returns true if the DSP is currently idle.

void reset()#

DSP internal state.

void release()#

Releases underlying DSP.

FmodDSPType get_type() const#

Returns DSP.

Dictionary get_info() const#

Returns DSP overview information, usually including name, version, channel count, and configuration width.

Dictionary get_cpu_usage() const#

Returns DSP CPU.

FmodSystem get_system_object() const#

Returns creates or DSP FMOD object.

Callback.#

Custom DSP units can receive FMOD lifecycle, processing, and parameter access callbacks through Callables. Each callback has matching set_*_callback(callback) and get_*_callback() methods.

Callback.

Methods

Description

Lifecycle.

createreleasereset

DSP creates, releases and when.

Processing

readprocessshouldiprocesssetposition

Audio read, block processing, processing state, and playback position changes.

Parameter sets.

setparam_floatsetparam_intsetparam_boolsetparam_data

DSP parameter when.

Parameter.

getparam_floatgetparam_intgetparam_boolgetparam_data

DSP parameter when.

Enumerations#

FmodDSPType#

Member

Value

Description

DSP_TYPE_UNKNOWN

0

Through FMOD creates.

DSP_TYPE_MIXER

1

Used for input.

DSP_TYPE_OSCILLATOR

2

Oscillator that can generate sine, square, saw, triangle, or noise waveforms.

DSP_TYPE_LOWPASS

3

Resonant low-pass filter, deprecated.

DSP_TYPE_ITLOWPASS

4

Impulse Tracker filter.

DSP_TYPE_HIGHPASS

5

Resonant high-pass filter, deprecated.

DSP_TYPE_ECHO

6

Effect.

DSP_TYPE_FADER

7

Volume and controls.

DSP_TYPE_FLANGE

8

Effect.

DSP_TYPE_DISTORTION

9

Distortion effect.

DSP_TYPE_NORMALIZE

10

Or sound to specified.

DSP_TYPE_LIMITER

11

Sound.

DSP_TYPE_PARAMEQ

12

Parametric equalizer, deprecated.

DSP_TYPE_PITCHSHIFT

13

In velocity pitch.

DSP_TYPE_CHORUS

14

Effect.

DSP_TYPE_ITECHO

15

Impulse Tracker.

DSP_TYPE_COMPRESSOR

16

Compression.

DSP_TYPE_SFXREVERB

17

SFX reverb effect.

DSP_TYPE_LOWPASS_SIMPLE

18

Filter.

DSP_TYPE_DELAY

19

Channel delay effect.

DSP_TYPE_TREMOLO

20

Effect.

DSP_TYPE_SEND

21

To returns DSP.

DSP_TYPE_RETURN

22

Receives signals from multiple send DSP units.

DSP_TYPE_HIGHPASS_SIMPLE

23

Filter.

DSP_TYPE_PAN

24

2D / 3D and channel.

DSP_TYPE_THREE_EQ

25

Three-band equalizer

DSP_TYPE_FFT

26

FFT spectrum analysis.

DSP_TYPE_LOUDNESS_METER

27

Loudness and true peak analysis.

DSP_TYPE_CONVOLUTIONREVERB

28

Reverb.

DSP_TYPE_CHANNELMIX

29

Channel Gain, Grouping, and Speaker Format Conversion

DSP_TYPE_TRANSCEIVER

30

Global slot-based send and receive.

DSP_TYPE_OBJECTPAN

31

Object spatialization.

DSP_TYPE_MULTIBAND_EQ

32

Parameter.

DSP_TYPE_MULTIBAND_DYNAMICS

33

Multiband dynamics processor, deprecated.

DSP_TYPE_MAX

34

DSP type boundary value.

DSP_TYPE_FORCEINT

65536

Forces the enum to be stored as an integer-sized value.

FmodDSPParameterDataType#

Member

Value

Description

DSP_PARAMETER_DATA_TYPE_USER

0

User Data

DSP_PARAMETER_DATA_TYPE_OVERALLGAIN

-1

Overall gain

DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES

-2

Single 3D attributes structure.

DSP_PARAMETER_DATA_TYPE_SIDECHAIN

-3

Sidechain data

DSP_PARAMETER_DATA_TYPE_FFT

-4

FFT.

DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES_MULTI

-5

Multiple 3D attributes structures.

DSP_PARAMETER_DATA_TYPE_ATTENUATION_RANGE

-6

Attenuation range.

DSP_PARAMETER_DATA_TYPE_DYNAMIC_RESPONSE

-7

Dynamic Response

DSP_PARAMETER_DATA_TYPE_FINITE_LENGTH

-8

Finite-length information

FmodDSPConnection#

Inherits: RefCounted

DSP node connection object.

Description#

FmodDSPConnection represents a connection between two FmodDSP units. It can adjust the connection mix level and mix matrix, and query the input and output DSP units.

Properties#

Type

Name

Default

Description

float

mix

0.0

Connection, unit as.

Methods#

void set_mix(volume_db: float)#

Sets connection.

float get_mix() const#

Returns connection.

void set_mix_matrix(matrix: PackedFloat32Array, outchannels: int, inchannels: int, inchannel_hop: int)#

Sets the connection mix matrix used to customize input-channel to output-channel mapping.

PackedFloat32Array get_mix_matrix(outchannels: int, inchannels: int, inchannel_hop: int) const#

Returns connection mix matrix.

FmodDSP get_input() const#

Returns connection input DSP.

FmodDSP get_output() const#

Returns connection output DSP.

FmodDSPConnectionType get_type() const#

Returns connection.

Enumerations#

FmodDSPConnectionType#

Member

Value

Description

DSPCONNECTION_TYPE_STANDARD

0

DSP connection.

DSPCONNECTION_TYPE_SIDECHAIN

1

Connection.

DSPCONNECTION_TYPE_SEND

2

Connection.

DSPCONNECTION_TYPE_SEND_SIDECHAIN

3

Connection.

FmodAudioEffect#

Inherits: Resource

can to FmodAudioBus audio effect.

Description#

FmodAudioEffect FMOD audio effect. effect creates DSP to FmodChannelGroup, and current bus and DSP.

Methods#

void apply_to(bus: FmodChannelGroup)#

Effect to specified channel group.

void remove_from_bus(bus: FmodChannelGroup)#

Specified channel group removes effect.

FmodChannelGroup get_bus() const#

Returns current to channel group.

FmodAudioEffectAmplify#

: FmodAudioEffect

Simple gain effect for amplifying or attenuating a signal.

Description#

FmodAudioEffectAmplify will in bus effect chain creates DSP. suitable for bus volume, when or attenuation, can in when volume_db or volume_linear controls.

Properties#

Type

Name

Default

Description

float

volume_db

0.0

Gain, in decibels.

float

volume_linear

1.0

In Inspector, can.

Methods#

void set_volume_db(volume_db: float)#

Sets .

float get_volume_db() const#

Returns .

void set_volume_linear(volume_linear: float)#

Sets .

float get_volume_linear() const#

Returns .

FmodAudioEffectFilter#

: FmodAudioEffect

Filter effect for shaping frequency response with cutoff frequency, slope, gain, and resonance.

Description#

FmodAudioEffectFilter provides basic filtering controls. Use cutoff_hz to set the cutoff frequency, db to choose the cutoff slope, and gain plus resonance to adjust the filtered signal level and resonance. It is suitable for low-pass, high-pass, occlusion, distance, and menu transition effects.

Properties#

Type

Name

Default

Description

float

cutoff_hz

2000.0

Cutoff frequency, in Hz.

FilterDB

db

FILTER_6DB

Cutoff curve slope

float

gain

1.0

Filtering after.

float

resonance

0.5

Resonance boost around the cutoff frequency.

Methods#

void set_cutoff_hz(cutoff_hz: float)#

Sets .

float get_cutoff_hz() const#

Returns .

void set_db(db: FilterDB)#

Sets filter.

FilterDB get_db() const#

Returns filter.

void set_gain(gain: float)#

Sets .

float get_gain() const#

Returns .

void set_resonance(resonance: float)#

Sets .

float get_resonance() const#

Returns .

Enumerations#

FilterDB#

Member

Value

Description

FILTER_6DB

0

6 dB.

FILTER_12DB

1

12 dB.

FILTER_18DB

2

18 dB.

FILTER_24DB

3

24 dB.

FmodAudioEffectEQ#

: FmodAudioEffect

Base class for multiband equalizers, using FMOD MULTIBAND_EQ DSP units to form 6-, 10-, or 21-band EQ.

Description#

FmodAudioEffectEQ builds a multiband equalizer from one or more FMOD MULTIBAND_EQ DSP units. It can create 6, 10, or 21 bands from presets, and each band can adjust gain, center frequency, Q value, and filter type.

Properties#

Type

Name

Default

Description

Preset

preset

PRESET_6_BANDS

Equalizer band preset

float

Band_0_gain to band_n_gain.

0.0

Gain for the corresponding band, in decibels.

float

Band_0_frequency to band_n_frequency.

Determined by preset

Center frequency for the corresponding band, in Hz.

float

Band_0_q to band_n_q.

0.707

Q value for the corresponding band.

FilterType

Band_0_filter_type to band_n_filter_type.

FILTER_PEAKING

Filter type for the corresponding band.

Methods#

void set_preset(preset: Preset)#

Sets the equalizer band preset and rebuilds the band list.

Preset get_preset() const#

Returns current.

int get_band_count() const#

Returns current.

void set_band_gain_db(band_idx: int, gain_db: float)#

Sets the gain of the specified band, in decibels.

float get_band_gain_db(band_idx: int) const#

Returns the gain of the specified band, in decibels.

void set_band_frequency(band_idx: int, frequency: float)#

Sets the center frequency of the specified band.

float get_band_frequency(band_idx: int) const#

Returns the center frequency of the specified band.

void set_band_filter_type(band_idx: int, filter_type: FilterType)#

Sets the filter type of the specified band.

FilterType get_band_filter_type(band_idx: int) const#

Returns the filter type of the specified band.

void set_band_q(band_idx: int, q: float)#

Sets the Q value of the specified band.

float get_band_q(band_idx: int) const#

Returns the Q value of the specified band.

Enumerations#

Preset#

Member

Value

Description

PRESET_6_BANDS

0

6-band equalizer

PRESET_10_BANDS

1

10-band equalizer

PRESET_21_BANDS

2

21-band equalizer

FilterType#

Member

Value

Description

FILTER_DISABLED

0

Disable this band

FILTER_LOWPASS_12DB

1

12 dB.

FILTER_LOWPASS_24DB

2

24 dB.

FILTER_LOWPASS_48DB

3

48 dB.

FILTER_HIGHPASS_12DB

4

12 dB.

FILTER_HIGHPASS_24DB

5

24 dB.

FILTER_HIGHPASS_48DB

6

48 dB.

FILTER_LOWSHELF

7

Low shelf

FILTER_HIGHSHELF

8

High shelf

FILTER_PEAKING

9

Filtering.

FILTER_BANDPASS

10

Filtering.

FILTER_NOTCH

11

Filtering.

FILTER_ALLPASS

12

Filtering.

FILTER_LOWPASS_6DB

13

6 dB.

FILTER_HIGHPASS_6DB

14

6 dB.

FmodAudioEffectEQ6#

: FmodAudioEffectEQ

6-band equalizer preset.

Description#

FmodAudioEffectEQ6 is the 6-band preset version of FmodAudioEffectEQ. Its default bands are 32, 100, 320, 1000, 3200, and 10000 Hz. It inherits all properties and methods from FmodAudioEffectEQ.

Properties#

Type

Name

Default

Description

float

Band_0_gain to band_n_gain.

0.0

Gain for the corresponding band, in decibels.

float

Band_0_frequency to band_n_frequency.

Determined by preset

Center frequency for the corresponding band, in Hz.

float

Band_0_q to band_n_q.

0.707

Q value for the corresponding band.

FilterType

Band_0_filter_type to band_n_filter_type.

FILTER_PEAKING

Filter type for the corresponding band.

Methods#

void set_preset(preset: Preset)#

Sets the equalizer band preset and rebuilds the band list.

Preset get_preset() const#

Returns current.

int get_band_count() const#

Returns current.

void set_band_gain_db(band_idx: int, gain_db: float)#

Sets the gain of the specified band, in decibels.

float get_band_gain_db(band_idx: int) const#

Returns the gain of the specified band, in decibels.

void set_band_frequency(band_idx: int, frequency: float)#

Sets the center frequency of the specified band.

float get_band_frequency(band_idx: int) const#

Returns the center frequency of the specified band.

void set_band_filter_type(band_idx: int, filter_type: FilterType)#

Sets the filter type of the specified band.

FilterType get_band_filter_type(band_idx: int) const#

Returns the filter type of the specified band.

void set_band_q(band_idx: int, q: float)#

Sets the Q value of the specified band.

float get_band_q(band_idx: int) const#

Returns the Q value of the specified band.

FmodAudioEffectEQ10#

: FmodAudioEffectEQ

10-band equalizer preset.

Description#

FmodAudioEffectEQ10 is the 10-band preset version of FmodAudioEffectEQ. Its default bands are 31.25, 62.5, 125, 250, 500, 1000, 2000, 4000, 8000, and 16000 Hz. It inherits all properties and methods from FmodAudioEffectEQ.

Properties#

Type

Name

Default

Description

float

Band_0_gain to band_n_gain.

0.0

Gain for the corresponding band, in decibels.

float

Band_0_frequency to band_n_frequency.

Determined by preset

Center frequency for the corresponding band, in Hz.

float

Band_0_q to band_n_q.

0.707

Q value for the corresponding band.

FilterType

Band_0_filter_type to band_n_filter_type.

FILTER_PEAKING

Filter type for the corresponding band.

Methods#

void set_preset(preset: Preset)#

Sets the equalizer band preset and rebuilds the band list.

Preset get_preset() const#

Returns current.

int get_band_count() const#

Returns current.

void set_band_gain_db(band_idx: int, gain_db: float)#

Sets the gain of the specified band, in decibels.

float get_band_gain_db(band_idx: int) const#

Returns the gain of the specified band, in decibels.

void set_band_frequency(band_idx: int, frequency: float)#

Sets the center frequency of the specified band.

float get_band_frequency(band_idx: int) const#

Returns the center frequency of the specified band.

void set_band_filter_type(band_idx: int, filter_type: FilterType)#

Sets the filter type of the specified band.

FilterType get_band_filter_type(band_idx: int) const#

Returns the filter type of the specified band.

void set_band_q(band_idx: int, q: float)#

Sets the Q value of the specified band.

float get_band_q(band_idx: int) const#

Returns the Q value of the specified band.

FmodAudioEffectEQ21#

: FmodAudioEffectEQ

21-band equalizer preset.

Description#

FmodAudioEffectEQ21 is the 21-band preset version of FmodAudioEffectEQ. Its default bands range from 22 Hz to 22000 Hz. It inherits all properties and methods from FmodAudioEffectEQ.

Properties#

Type

Name

Default

Description

float

Band_0_gain to band_n_gain.

0.0

Gain for the corresponding band, in decibels.

float

Band_0_frequency to band_n_frequency.

Determined by preset

Center frequency for the corresponding band, in Hz.

float

Band_0_q to band_n_q.

0.707

Q value for the corresponding band.

FilterType

Band_0_filter_type to band_n_filter_type.

FILTER_PEAKING

Filter type for the corresponding band.

Methods#

void set_preset(preset: Preset)#

Sets the equalizer band preset and rebuilds the band list.

Preset get_preset() const#

Returns current.

int get_band_count() const#

Returns current.

void set_band_gain_db(band_idx: int, gain_db: float)#

Sets the gain of the specified band, in decibels.

float get_band_gain_db(band_idx: int) const#

Returns the gain of the specified band, in decibels.

void set_band_frequency(band_idx: int, frequency: float)#

Sets the center frequency of the specified band.

float get_band_frequency(band_idx: int) const#

Returns the center frequency of the specified band.

void set_band_filter_type(band_idx: int, filter_type: FilterType)#

Sets the filter type of the specified band.

FilterType get_band_filter_type(band_idx: int) const#

Returns the filter type of the specified band.

void set_band_q(band_idx: int, q: float)#

Sets the Q value of the specified band.

float get_band_q(band_idx: int) const#

Returns the Q value of the specified band.

FmodAudioEffectDelay#

: FmodAudioEffect

Dual-tap delay and feedback delay effect.

Description#

FmodAudioEffectDelay provides two independent taps and an optional feedback loop. Each tap can set delay time, level, and pan, while the feedback loop can set delay, level, and low-pass cutoff frequency.

Properties#

Type

Name

Default

Description

float

dry

1.0

Original signal level

bool

tap1_active

true

Delay Tap.

float

tap1_delay_ms

250.0

Tap delay when.

float

tap1_level_db

-6.0

Level of the first tap.

float

tap1_pan

0.2

Pan of the first tap.

bool

tap2_active

true

Delay Tap.

float

tap2_delay_ms

500.0

Tap delay when.

float

tap2_level_db

-12.0

Level of the second tap.

float

tap2_pan

-0.4

Pan of the second tap.

bool

feedback_active

false

Delay.

float

feedback_delay_ms

340.0

Delay when.

float

feedback_level_db

-6.0

Feedback level

float

feedback_lowpass

16000.0

Feedback low-pass cutoff frequency

Methods#

void set_dry(dry: float)#

Sets .

float get_dry()#

Returns .

void set_tap1_active(active: bool)#

Or Tap.

bool is_tap1_active() const#

Returns Tap.

void set_tap1_delay_ms(delay_ms: float)#

Sets Tap delay when.

float get_tap1_delay_ms() const#

Returns Tap delay when.

void set_tap1_level_db(level_db: float)#

Sets Tap.

float get_tap1_level_db() const#

Returns Tap.

void set_tap1_pan(pan: float)#

Sets Tap.

float get_tap1_pan() const#

Returns Tap.

void set_tap2_active(active: bool)#

Or Tap.

bool is_tap2_active() const#

Returns Tap.

void set_tap2_delay_ms(delay_ms: float)#

Sets Tap delay when.

float get_tap2_delay_ms() const#

Returns Tap delay when.

void set_tap2_level_db(level_db: float)#

Sets Tap.

float get_tap2_level_db() const#

Returns Tap.

void set_tap2_pan(pan: float)#

Sets Tap.

float get_tap2_pan() const#

Returns Tap.

void set_feedback_active(active: bool)#

Or delay.

bool is_feedback_active() const#

Returns delay.

void set_feedback_delay_ms(delay_ms: float)#

Sets delay when.

float get_feedback_delay_ms() const#

Returns delay when.

void set_feedback_level_db(level_db: float)#

Sets .

float get_feedback_level_db() const#

Returns .

void set_feedback_lowpass(lowpass: float)#

Sets .

float get_feedback_lowpass() const#

Returns .

FmodAudioEffectChorus#

: FmodAudioEffect

Chorus effect with per-voice delay, rate, depth, level, cutoff frequency, and pan controls.

Description#

FmodAudioEffectChorus layers several slightly delayed and modulated voices to create a chorus sound. You can control the overall dry/wet mix and adjust delay, modulation rate, depth, level, cutoff frequency, and pan for each voice.

Properties#

Type

Name

Default

Description

int

voice_count

2

And voice.

float

wet

0.5

Effect.

float

dry

1.0

Original signal level

Methods#

void set_voice_count(voices: int)#

Sets voice.

int get_voice_count() const#

Returns voice.

void set_wet(amount: float)#

Sets effect.

float get_wet() const#

Returns effect.

void set_dry(amount: float)#

Sets .

float get_dry() const#

Returns .

void set_voice_delay_ms(voice: int, delay_ms: float)#

Sets the delay time of the specified voice.

float get_voice_delay_ms(voice: int) const#

Returns the delay time of the specified voice.

void set_voice_rate_hz(voice: int, rate_hz: float)#

Sets the modulation rate of the specified voice.

float get_voice_rate_hz(voice: int) const#

Returns the modulation rate of the specified voice.

void set_voice_depth_ms(voice: int, depth_ms: float)#

Sets the modulation depth of the specified voice.

float get_voice_depth_ms(voice: int) const#

Returns the modulation depth of the specified voice.

void set_voice_level_db(voice: int, level_db: float)#

Sets the level of the specified voice.

float get_voice_level_db(voice: int) const#

Returns the level of the specified voice.

void set_voice_cutoff_hz(voice: int, cutoff_hz: float)#

Sets the cutoff frequency of the specified voice.

float get_voice_cutoff_hz(voice: int) const#

Returns the cutoff frequency of the specified voice.

void set_voice_pan(voice: int, pan: float)#

Sets the pan of the specified voice.

float get_voice_pan(voice: int) const#

Returns the pan of the specified voice.

FmodAudioEffectDistortion#

: FmodAudioEffect

Distortion effect supporting clipping, arctangent distortion, lo-fi, overdrive, waveshaping, and bit crushing.

Description#

FmodAudioEffectDistortion creates a custom distortion DSP in the effect chain. Use mode to switch distortion algorithms, with controls for pre-gain, drive, post-gain, high-frequency preservation, and oversampling.

Properties#

Type

Name

Default

Description

Mode

mode

MODE_CLIP

Distortion.

float

pre_gain

0.0

Distortion before.

float

drive

0.0

Distortion.

float

post_gain

0.0

Distortion after.

float

keep_hf_hz

16000.0

High-frequency preservation frequency

int

oversample

4

Oversampling factor

Methods#

void set_mode(mode: Mode)#

Sets distortion.

Mode get_mode() const#

Returns distortion.

void set_pre_gain(gain: float)#

Sets before.

float get_pre_gain() const#

Returns before.

void set_drive(drive: float)#

Sets .

float get_drive() const#

Returns .

void set_post_gain(gain: float)#

Sets after.

float get_post_gain() const#

Returns after.

void set_keep_hf_hz(hz: float)#

Sets .

float get_keep_hf_hz() const#

Returns .

void set_oversample(oversample: int)#

Sets .

int get_oversample() const#

Returns .

Enumerations#

Mode#

Member

Value

Description

MODE_CLIP

0

Hard clipping

MODE_ATAN

1

Arctangent soft clipping

MODE_LOFI

2

Distortion.

MODE_OVERDRIVE

3

Distortion.

MODE_WAVESHAPE

4

Waveshaping

MODE_BITCRUSH

5

Bit crushing

FmodAudioEffectPhaser#

: FmodAudioEffect

Phaser effect.

Description#

FmodAudioEffectPhaser through, or. range_min_hz and range_max_hz controls range, rate_hz controls velocity, depth and feedback controls effect.

Properties#

Type

Name

Default

Description

float

depth

1.0

Modulation depth

float

feedback

0.7

Feedback amount

float

range_max_hz

1600.0

Range.

float

range_min_hz

440.0

Range.

float

rate_hz

0.5

Modulation rate

Methods#

void set_depth(depth: float)#

Sets .

float get_depth() const#

Returns .

void set_feedback(feedback: float)#

Sets .

float get_feedback() const#

Returns .

void set_range_max_hz(range_max_hz: float)#

Sets range.

float get_range_max_hz() const#

Returns range.

void set_range_min_hz(range_min_hz: float)#

Sets range.

float get_range_min_hz() const#

Returns range.

void set_rate_hz(rate_hz: float)#

Sets .

float get_rate_hz() const#

Returns .

FmodAudioEffectPitchShift#

: FmodAudioEffect

Pitch shifting effect.

Description#

FmodAudioEffectPitchShift FFT pitch. pitch_scale controls pitch, fft_size and oversampling will sound, delay and CPU.

Properties#

Type

Name

Default

Description

float

pitch_scale

1.0

Pitch.

FFTSize

fft_size

FFT_SIZE_2048

FFT.

int

oversampling

4

Oversampling factor

Methods#

void set_pitch_scale(pitch_scale: float)#

Sets pitch.

float get_pitch_scale() const#

Returns pitch.

void set_fft_size(fft_size: FFTSize)#

Sets FFT.

FFTSize get_fft_size() const#

Returns FFT.

void set_oversampling(oversampling: int)#

Sets .

int get_oversampling() const#

Returns .

Enumerations#

FFTSize#

Member

Value

Description

FFT_SIZE_256

0

256 FFT.

FFT_SIZE_512

1

512 FFT.

FFT_SIZE_1024

2

1024 FFT.

FFT_SIZE_2048

3

2048 FFT.

FFT_SIZE_4096

4

4096 FFT.

FFT_SIZE_MAX

5

Boundary value

FmodAudioEffectCompressor#

: FmodAudioEffect

Dynamic compressor.

Description#

FmodAudioEffectCompressor reduces the dynamic range above the threshold and can compensate loudness with output gain. threshold_db sets where compression begins, ratio sets compression strength, attack_us and release_ms control response speed, and mix can be used for parallel compression.

Properties#

Type

Name

Default

Description

float

threshold_db

0.0

Compression.

float

ratio

4.0

Compression.

float

gain_db

0.0

Output.

float

attack_us

20.0

When, unit as.

float

release_ms

250.0

Releases when, unit as.

float

mix

1.0

Dry/wet mix ratio

StringName

sidechain

Empty

Bus; current FMOD bus routing.

Methods#

void set_threshold(threshold_db: float)#

Sets compression.

float get_threshold() const#

Returns compression.

void set_ratio(ratio: float)#

Sets compression.

float get_ratio() const#

Returns compression.

void set_gain(gain_db: float)#

Sets output.

float get_gain() const#

Returns output.

void set_attack_us(attack_us: float)#

Sets when.

float get_attack_us() const#

Returns when.

void set_release_ms(release_ms: float)#

Sets releases when.

float get_release_ms() const#

Returns releases when.

void set_mix(mix: float)#

Sets .

float get_mix() const#

Returns .

void set_sidechain(sidechain: StringName)#

Sets bus.

StringName get_sidechain() const#

Returns the sidechain bus name.

FmodAudioEffectHardLimiter#

: FmodAudioEffect

Hard limiter for limiting peak level.

Description#

FmodAudioEffectHardLimiter prevents signal peaks from exceeding the specified ceiling. It is often placed near the end of a bus effect chain to protect output, suppress sudden peaks, or provide a simple safety limit for a bus.

Properties#

Type

Name

Default

Description

float

ceiling_db

-0.3

Output.

float

pre_gain_db

0.0

Before.

float

release

0.1

Releases when.

Methods#

void set_ceiling_db(ceiling_db: float)#

Sets output.

float get_ceiling_db() const#

Returns output.

void set_pre_gain_db(pre_gain_db: float)#

Sets before.

float get_pre_gain_db() const#

Returns before.

void set_release(release: float)#

Sets releases when.

float get_release() const#

Returns releases when.

FmodAudioEffectPanner#

: FmodAudioEffect

Left/right panning control.

Description#

FmodAudioEffectPanner provides. pan as when, as when, suitable for 2D UI sound, spatialization or bus.

Properties#

Type

Name

Default

Description

float

pan

0.0

Pan position. Negative values pan left; positive values pan right.

Methods#

void set_pan(pan: float)#

Sets position.

float get_pan() const#

Returns position.

FmodAudioEffectReverb#

: FmodAudioEffect

Bus reverb effect with parameters similar to Godot’s AudioEffectReverb.

Description#

FmodAudioEffectReverb is a bus reverb effect with parameters similar to Godot’s AudioEffectReverb. It shapes space with room size, damping, predelay, diffusion, and dry/wet mix, making it suitable for applying shared ambience to a group of sounds.

Properties#

Type

Name

Default

Description

float

damping

0.5

High-frequency damping

float

dry

1.0

Original signal level

float

hipass

0.0

Filtering.

float

predelay_feedback

0.4

Delay.

float

predelay_msec

150.0

Delay when, unit as.

float

room_size

0.8

Room size

float

spread

1.0

Stereo spread

float

wet

0.5

Reverb.

Methods#

void set_damping(damping: float)#

Sets .

float get_damping() const#

Returns .

void set_dry(dry: float)#

Sets .

float get_dry() const#

Returns .

void set_hpf(hpf: float)#

Sets filtering.

float get_hpf() const#

Returns filtering.

void set_predelay_feedback(predelay_feedback: float)#

Sets delay.

float get_predelay_feedback() const#

Returns delay.

void set_predelay_msec(predelay_msec: float)#

Sets delay when.

float get_predelay_msec() const#

Returns delay when.

void set_room_size(room_size: float)#

Sets .

float get_room_size() const#

Returns .

void set_spread(spread: float)#

Sets .

float get_spread() const#

Returns .

void set_wet(wet: float)#

Sets reverb.

float get_wet() const#

Returns reverb.

FmodAudioEffectStereoEnhance#

: FmodAudioEffect

Stereo enhancement effect.

Description#

FmodAudioEffectStereoEnhance used for or. pan_pullout, time_pullout_ms when, surround controls.

Properties#

Type

Name

Default

Description

float

pan_pullout

1.0

Pan separation amount

float

time_pullout_ms

0.0

When, unit as.

float

surround

0.0

Surround enhancement amount

Methods#

void set_pan_pullout(amount: float)#

Sets .

float get_pan_pullout() const#

Returns .

void set_time_pullout(amount: float)#

Sets when.

float get_time_pullout() const#

Returns when.

void set_surround(amount: float)#

Sets .

float get_surround() const#

Returns .

FmodAudioEffectSpectrumAnalyzer#

: FmodAudioEffect

Spectrum analyzer that can read band magnitudes, RMS, and spectral centroid.

Description#

FmodAudioEffectSpectrumAnalyzer inserts an FFT DSP into the bus effect chain and reads spectrum data from it. It does not alter the sound by itself, and is mainly useful for visualization, beat or energy detection, band-driven UI, and mix debugging.

Properties#

Type

Name

Default

Description

float

buffer_length

2.0

Analysis buffer length, in seconds.

FFTSize

fft_size

FFT_SIZE_1024

FFT.

Methods#

void set_buffer_length(buffer_length: float)#

Sets .

float get_buffer_length() const#

Returns .

void set_fft_size(fft_size: FFTSize)#

Sets FFT.

FFTSize get_fft_size() const#

Returns FFT.

void update_spectrum()#

Actively refreshes spectrum data.

int get_bin_count() const#

Returns current bin.

float get_rms() const#

Returns current RMS.

float get_centroid() const#

Returns current.

Vector2 get_magnitude_for_frequency_range(begin: float, end: float, mode: MagnitudeMode = MAGNITUDE_MAX) const#

Returns the left and right channel magnitudes within the specified frequency range.

Enumerations#

FFTSize#

Member

Value

Description

FFT_SIZE_256

0

256 FFT.

FFT_SIZE_512

1

512 FFT.

FFT_SIZE_1024

2

1024 FFT.

FFT_SIZE_2048

3

2048 FFT.

FFT_SIZE_4096

4

4096 FFT.

FFT_SIZE_MAX

5

Boundary value

MagnitudeMode#

Member

Value

Description

MAGNITUDE_AVERAGE

0

Returns range.

MAGNITUDE_MAX

1

Returns range.

Example#

@onready var bus := FmodServer.get_bus("Master")
var analyzer := FmodAudioEffectSpectrumAnalyzer.new()

func _ready():
    analyzer.fft_size = FmodAudioEffectSpectrumAnalyzer.FFT_SIZE_2048
    analyzer.buffer_length = 1.0
    bus.add_effect(analyzer)

func _process(_delta):
    analyzer.update_spectrum()
    var low := analyzer.get_magnitude_for_frequency_range(20.0, 250.0, FmodAudioEffectSpectrumAnalyzer.MAGNITUDE_AVERAGE)
    var mid := analyzer.get_magnitude_for_frequency_range(250.0, 4000.0)
    var high := analyzer.get_magnitude_for_frequency_range(4000.0, 16000.0)
    print("low: ", low.length(), " mid: ", mid.length(), " high: ", high.length())
    print("rms: ", analyzer.get_rms(), " centroid: ", analyzer.get_centroid())

FmodAudioEffectRecord#

: FmodAudioEffect

Recording effect that passes the signal through unchanged and caches audio passing through the bus while recording.

Description#

FmodAudioEffectRecord is a pass-through recording DSP. It does not change the bus output; when recording_active is enabled, it writes audio passing through the effect into an internal buffer. After recording stops, use get_recording() to obtain an AudioStreamWAV, or get_waveform_snapshot() to obtain waveform preview data.

Properties#

Type

Name

Default

Description

FmodAudioEffectRecord.Format

format

FORMAT_16_BITS

As AudioStreamWAV when.

bool

recording_active

false

In.

Methods#

void set_recording_active(record: bool)#

Or stop.

bool is_recording_active() const#

Returns current in.

void set_format(format: FmodAudioEffectRecord.Format)#

Sets WAV.

FmodAudioEffectRecord.Format get_format() const#

Returns WAV.

AudioStreamWAV get_recording() const#

Returns current cache WAV audio stream.

PackedVector2Array get_waveform_snapshot(width: int = 512, seconds: float = 5.0) const#

Returns .

Enumerations#

Format#

Member

Value

Description

FORMAT_8_BITS

0

8-bit PCM WAV.

FORMAT_16_BITS

1

16-bit PCM WAV.

FORMAT_IMA_ADPCM

2

IMA ADPCM; current will 16-bit PCM WAV.

Example#

@onready var bus := FmodServer.get_bus("Master")
var recorder := FmodAudioEffectRecord.new()
var recorded_stream: AudioStreamWAV

func _ready():
    recorder.format = FmodAudioEffectRecord.FORMAT_16_BITS
    bus.add_effect(recorder)

func start_recording():
    recorder.recording_active = true

func stop_recording():
    recorder.recording_active = false
    recorded_stream = recorder.get_recording()

    if recorded_stream:
        var player := AudioStreamPlayer.new()
        add_child(player)
        player.stream = recorded_stream
        player.play()

func get_waveform_points() -> PackedVector2Array:
    return recorder.get_waveform_snapshot(256, 3.0)

FmodAudioEffectCapture#

: FmodAudioEffect

Capture effect that can read audio frames passing through the bus from a ring buffer.

Description#

FmodAudioEffectCapture will bus audio internal, and PackedVector2Array. suitable for when, audio, before cache, or FMOD output Godot.

Properties#

Type

Name

Default

Description

float

buffer_length

1.0

Ring buffer length, in seconds.

Methods#

void set_buffer_length(buffer_length: float)#

Sets .

float get_buffer_length() const#

Returns .

bool can_get_buffer(frames: int) const#

Returns true if specified can.

PackedVector2Array get_buffer(frames: int)#

Specified and returns audio.

void clear_buffer()#

Clears .

int get_discarded_frames() const#

Returns .

int get_frames_available() const#

Returns current can.

int get_pushed_frames() const#

Returns .