Spatial Audio API#
FmodGeometry#
Inherits: RefCounted
FMOD geometry object for 3D sound occlusion calculation.
Description#
FmodGeometry wraps FMOD Geometry and describes walls, terrain, doors, and other occluders with polygons. FMOD uses the geometry between the sound source and listener to calculate direct and reverb occlusion, often making 3D sounds behind walls quieter, duller, or less reverberant.
Geometry is usually created with FmodSystem.create_geometry(), or loaded from saved byte data with FmodSystem.load_geometry().
Note
Occlusion usually needs in FMOD when FMOD_INIT_FLAG_CHANNEL_LOWPASS, otherwise occlusion effect will.
Properties#
Methods#
Validity Check#
bool geometry_is_valid() const#
Returns true if underlying FMOD Geometry handle.
bool geometry_is_null() const#
Returns true if the underlying FMOD Geometry handle is null or unavailable.
Polygon.#
int add_polygon(direct_occlusion: float, reverb_occlusion: float, double_sided: bool, vertices: PackedVector3Array)#
Geometry adds occlusion polygon, and returns polygon index. direct_occlusion controls direct occlusion, reverb_occlusion controls reverb path occlusion, range usually as 0.0 to 1.0.
void set_polygon_attributes(index: int, direct_occlusion: float, reverb_occlusion: float, double_sided: bool)#
Specified polygon occlusion.
Dictionary get_polygon_attributes(index: int) const#
Returns polygon, direct_occlusion, reverb_occlusion and double_sided.
int get_polygon_num_vertices(index: int) const#
Returns the vertex count of the specified polygon.
void set_polygon_vertex(index: int, vertex_index: int, vertex: Vector3)#
Sets the position of a single vertex in the specified polygon.
Vector3 get_polygon_vertex(index: int, vertex_index: int) const#
Returns the position of a single vertex in the specified polygon.
Dictionary get_max_polygons() const#
Returns geometry, usually max_polygons and max_vertices.
Transform.#
void set_position(position: Vector3)#
Sets geometry position.
Vector3 get_position() const#
Returns geometry position.
void set_rotation(rotation: Vector3)#
Sets geometry.
Vector3 get_rotation() const#
Returns geometry.
void set_scale(scale: Vector3)#
Sets geometry.
Vector3 get_scale() const#
Returns geometry.
void set_transform(transform: Transform3D)#
Synchronizes geometry 3D transform.
State and.#
void set_active(active: bool)#
Or geometry occlusion calculates.
bool get_active() const#
Returns true if the geometry is active.
int get_save_size() const#
Returns current geometry.
PackedByteArray save() const#
Serializes the geometry to a byte array that can later be loaded with FmodSystem.load_geometry().
void release()#
Releases the underlying FMOD Geometry. After release, the object should no longer be used for occlusion calculation.
FmodReverb3D#
Inherits: RefCounted
FMOD 3D reverb object used to create spherical reverb zones
Description#
FmodReverb3D represents a low-level 3D reverb zone. Its influence is defined by center position, minimum distance, and maximum distance: sources inside the minimum distance receive full reverb, sources between minimum and maximum distance fade out gradually, and sources beyond the maximum distance are mostly unaffected.
This object is usually created with FmodSystem.create_reverb_3d(). If you want a reverb zone directly in the scene tree that follows a node position, use FmodReverbZone3D.
Properties#
Type |
Name |
Default |
Description |
|---|---|---|---|
active |
true |
Reverb and output. |
|
decay_time |
1500.0 |
Reverb attenuation when, unit as. |
|
density |
100.0 |
After reverb, range usually as |
|
diffusion |
50.0 |
Range usually as |
|
early_delay |
7.0 |
Delay, unit as. |
|
early_late_mix |
50.0 |
And after reverb. |
|
hf_decay_ratio |
50.0 |
Attenuation. |
|
hf_reference |
5000.0 |
High-frequency reference frequency, in Hz. |
|
high_cut |
0.0 |
Or attenuation parameter. |
|
late_delay |
11.0 |
After reverb delay, unit as. |
|
low_shelf_frequency |
250.0 |
Low-shelf reference frequency, in Hz. |
|
low_shelf_gain |
0.0 |
Low-shelf gain, in decibels. |
|
wet_level |
-6.0 |
Reverb, unit as. |
Methods#
Range.#
void set_3d_attributes(position: Vector3, min_distance: float, max_distance: float)#
Sets reverb zone position, reverb and.
Dictionary get_3d_attributes() const#
Returns 3D, position, min_distance and max_distance.
void set_properties(properties: Dictionary)#
Sets reverb parameter. suitable for and resume.
Dictionary get_properties() const#
Returns current reverb parameter.
Parameter#
Methods |
Description |
|---|---|
|
Sets or returns reverb attenuation when. |
|
Sets or returns delay. |
|
Sets or returns after reverb delay. |
|
Sets or returns. |
|
Sets or returns attenuation. |
|
Sets or returns reverb. |
|
Sets or returns reverb. |
|
Sets or returns. |
|
Sets or returns. |
|
Sets or returns parameter. |
|
Sets or returns / after reverb. |
|
Sets or returns reverb. |
State and.#
void set_active(active: bool)#
Or reverb zone.
bool get_active() const#
Returns true if reverb zone state.
bool reverb_3d_is_valid() const#
Returns true if underlying FMOD Reverb3D handle.
bool reverb_3d_is_null() const#
Returns true if the underlying FMOD Reverb3D handle is null or unavailable.
void release()#
Releases underlying FMOD Reverb3D.
FmodReverbZone3D#
Inherits: Node3D
scene tree 3D reverb zone node.
Description#
FmodReverbZone3D is a node wrapper around FmodReverb3D. When the node enters the scene tree, it creates an internal reverb object and uses the node’s global position as the center of the spherical reverb zone. When sync_transform is enabled, node movement is synchronized to the FMOD reverb zone.
Properties#
Type |
Name |
Default |
Description |
|---|---|---|---|
active |
true |
Reverb zone and output. |
|
sync_transform |
true |
Synchronizes node position to internal reverb object. |
|
min_distance |
5.0 |
Reverb. |
|
max_distance |
20.0 |
Reverb. |
|
preset |
PRESET_GENERIC |
Reverb; parameter after will as |
|
decay_time |
1500.0 |
Reverb attenuation when, unit as. |
|
early_delay |
7.0 |
Delay, unit as. |
|
late_delay |
11.0 |
After reverb delay, unit as. |
|
hf_reference |
5000.0 |
High-frequency reference frequency, in Hz. |
|
hf_decay_ratio |
83.0 |
Attenuation. |
|
diffusion |
100.0 |
Diffusion |
|
density |
100.0 |
Density |
|
low_shelf_frequency |
250.0 |
Low-shelf reference frequency |
|
low_shelf_gain |
0.0 |
Low-shelf gain |
|
high_cut |
14500.0 |
High-frequency cutoff |
|
early_late_mix |
96.0 |
/ after reverb. |
|
wet_level |
-8.0 |
Reverb, unit as. |
Methods#
FmodReverb3D get_reverb() const#
Returns the FmodReverb3D created and managed internally by this node. Returns null if the node has not entered the scene tree or creation failed.
Note
Through getter / setter, set_min_distance() / get_min_distance(), set_preset() / get_preset() and set_wet_level() / get_wet_level().
Enumerations#
Preset#
Member |
Value |
Description |
|---|---|---|
PRESET_CUSTOM |
0 |
Parameter. |
PRESET_OFF |
1 |
Reverb. |
PRESET_GENERIC |
2 |
Reverb. |
PRESET_PADDED_CELL |
3 |
Padded cell |
PRESET_ROOM |
4 |
Room |
PRESET_BATHROOM |
5 |
Bathroom |
PRESET_LIVING_ROOM |
6 |
Living room |
PRESET_STONE_ROOM |
7 |
Stone room |
PRESET_AUDITORIUM |
8 |
Auditorium |
PRESET_CONCERT_HALL |
9 |
Concert hall |
PRESET_CAVE |
10 |
Cave |
PRESET_ARENA |
11 |
Arena |
PRESET_HANGAR |
12 |
Hangar |
PRESET_HALLWAY |
13 |
Hallway |
PRESET_STONE_CORRIDOR |
14 |
Stone corridor |
PRESET_ALLEY |
15 |
Alley |
PRESET_FOREST |
16 |
Forest |
PRESET_CITY |
17 |
City |
PRESET_MOUNTAINS |
18 |
Mountains |
PRESET_UNDERWATER |
19 |
Underwater |