HammeriteAudioManager
Audio. Inherits RefCounted
One map's sound: plays sounds through its audio graph, sets the reverb, and tells listeners.
Manages all acoustic propagation logic, sound playback, and audio stream management. Kept in the view's runtime data (HammeriteMap3D.get_runtime_data()) by the HammeriteAudio autoload, which makes a new one whenever the map or its variant changes; reach it with HammeriteAudio.get_manager(node) rather than holding on to one.
Responsibilities: - Sound submission API for entities - AudioStreamPlayer3D pool management (dynamic allocation) - AudioStream caching with resource names as keys - All propagation calculations (zone detection, portal finding, path queries) - Position && volume updates each frame - Reverb application based on listener position - Multi-source sound support
============================================================================== INNER CLASSES - Type-safe sound data containers ==============================================================================
What one sound is and is doing. Taken from the HammeriteAudioSoundSpec it was created from, and the manager's own from then on: the spec is read once and never held, so a caller may reuse it.
Native since 2.0 (#269): BUS_NAME is bus_name(), and its inner sound classes are HammeriteAudioManagerSoundData and the two that extend it.
Properties
| Type | Name | Default |
|---|---|---|
HammeriteAudioHearing | hearing | |
HammeriteMap | map | |
HammeriteAudioMixSettings | mix | |
HammeriteAudioSoundTypes | sound_types |
Methods
| Returns | Method |
|---|---|
String | bus_name() static |
void | cleanup() |
void | clear_cache() |
int | create_environmental_sound(spec: HammeriteAudioSoundSpec) |
int | create_positional_sound(spec: HammeriteAudioSoundSpec) |
bool | delete_sound(handle: int) |
void | initialize(audio_graph: HammeriteAudioNodeGraph, map: HammeriteMap, map_3d: HammeriteMap3D) |
bool | is_sound_playing(handle: int) const |
bool | play_sound(handle: int) |
void | press_ear_to_portal(portal_name: String, gain_db: float) |
bool | set_portal_occlusion(portal_name: String, occlusion: float) |
bool | set_sound_attenuation_scale(handle: int, attenuation_scale: float) |
bool | set_sound_direction(handle: int, direction: Vector3) |
bool | set_sound_looping(handle: int, loop: bool) |
bool | set_sound_position(handle: int, position: Vector3) |
bool | set_sound_propagation(handle: int, propagate: bool) |
bool | set_sound_volume_db(handle: int, volume_db: float) |
bool | stop_sound(handle: int) |
void | take_ear_from_portal() |
void | update(delta: float) |
void | update_for_listener(delta: float, listener_position: Vector3) |
Property descriptions
hearing
var hearing: HammeriteAudioHearing
Undocumented.
map
var map: HammeriteMap
Undocumented.
mix
var mix: HammeriteAudioMixSettings
Undocumented.
sound_types
var sound_types: HammeriteAudioSoundTypes
Undocumented.
Method descriptions
bus_name()
static func bus_name() -> String
Undocumented.
cleanup()
func cleanup() -> void
Undocumented.
clear_cache()
func clear_cache() -> void
Undocumented.
create_environmental_sound()
func create_environmental_sound(spec: HammeriteAudioSoundSpec) -> int
Undocumented.
create_positional_sound()
func create_positional_sound(spec: HammeriteAudioSoundSpec) -> int
Undocumented.
delete_sound()
func delete_sound(handle: int) -> bool
Undocumented.
initialize()
func initialize(audio_graph: HammeriteAudioNodeGraph, map: HammeriteMap, map_3d: HammeriteMap3D) -> void
Undocumented.
is_sound_playing()
func is_sound_playing(handle: int) -> bool
Undocumented.
play_sound()
func play_sound(handle: int) -> bool
Undocumented.
press_ear_to_portal()
func press_ear_to_portal(portal_name: String, gain_db: float) -> void
Undocumented.
set_portal_occlusion()
func set_portal_occlusion(portal_name: String, occlusion: float) -> bool
Undocumented.
set_sound_attenuation_scale()
func set_sound_attenuation_scale(handle: int, attenuation_scale: float) -> bool
Undocumented.
set_sound_direction()
func set_sound_direction(handle: int, direction: Vector3) -> bool
Undocumented.
set_sound_looping()
func set_sound_looping(handle: int, loop: bool) -> bool
Undocumented.
set_sound_position()
func set_sound_position(handle: int, position: Vector3) -> bool
Undocumented.
set_sound_propagation()
func set_sound_propagation(handle: int, propagate: bool) -> bool
Undocumented.
set_sound_volume_db()
func set_sound_volume_db(handle: int, volume_db: float) -> bool
Undocumented.
stop_sound()
func stop_sound(handle: int) -> bool
Undocumented.
take_ear_from_portal()
func take_ear_from_portal() -> void
Undocumented.
update()
func update(delta: float) -> void
Undocumented.
update_for_listener()
func update_for_listener(delta: float, listener_position: Vector3) -> void
Undocumented.