HammeriteAudioSoundSpec

Audio. Inherits Resource

What to play and how: the description a sound is created from.

Handed to HammeriteAudioManager.create_positional_sound() or HammeriteAudioManager.create_environmental_sound(), which read it once and keep their own copy of what it said. So one spec can create any number of sounds, and changing it afterwards changes none of them - what a sound is doing now is changed through the manager, by its handle.

 var spec := HammeriteAudioSoundSpec.new() spec.sound_file = "doors/creak.ogg" spec.position = door.global_position var handle := manager.create_positional_sound(spec) manager.play_sound(handle) 

A resource, so a game can author one beside the thing that makes the noise rather than building it in code. Most sounds want an HammeriteAudioEmitter3D or HammeriteAudio.play_one_shot() instead; this is the layer under both.

The recording, by its name in HammeriteAudioRuntime.sounds - doors/creak.ogg under one of its search paths - or by a resource path. A name that resolves to nothing creates no sound.

Properties

TypeNameDefault
floatattenuation_scale1.0
Vector3directionVector3(0, 0, 0)
boolfree_when_finishedfalse
boolloopfalse
floatmax_distance0.0
Vector3positionVector3(0, 0, 0)
boolpropagatetrue
Stringsound_file""
floatvolume_db0.0

Property descriptions

attenuation_scale

var attenuation_scale: float = 1.0

Undocumented.

direction

var direction: Vector3 = Vector3(0, 0, 0)

Undocumented.

free_when_finished

var free_when_finished: bool = false

Undocumented.

loop

var loop: bool = false

Undocumented.

max_distance

var max_distance: float = 0.0

Undocumented.

position

var position: Vector3 = Vector3(0, 0, 0)

Undocumented.

propagate

var propagate: bool = true

Undocumented.

sound_file

var sound_file: String = ""

Undocumented.

volume_db

var volume_db: float = 0.0

Undocumented.

Hammerite 2.0 · built from 6d57ab2d, 2026-10-17