acron.audio¶
Audio – Godot AudioStreamPlayer / AudioStreamPlayer3D on Acron.
2D SFX/music load via loader.loadSfx / loadMusic; positional 3D sounds
use Audio3DManager attached to the camera. A small SoundBank
caches loaded clips so a sound file loads once. Random-pitch playback (Godot’s
AudioStreamRandomizer) is supported via play(rate_jitter=..).
SfxPlayers is the polyphonic counterpart: Godot game scripts’ bank of
sibling one-shot AudioStreamPlayer nodes, with voice limiting.
Paths may be Godot res:// URIs (resolved via acron.res) or plain
filesystem paths.
A positional sound must be MONO – see mono_source(), which every
play_3d goes through.
|
Godot game scripts' polyphonic SFX pattern: a bank of |
|
Loads + caches SFX and music; plays 2D or 3D (positional). |
Global Functions
- mono_source(path) Filename¶
pathas a sound file OpenAL can spatialize – i.e. a mono one.A mono source is returned unchanged. Anything else is decoded (through
MovieAudio, so any format Acron can open counts – WAV, Ogg, FLAC), averaged down to one channel and written into theMONO_MOUNTramdisk; the result is cached per source path, so a file is converted once per run. A file that cannot be decoded comes back unchanged, and playing it positionally then warns exactly as it did before.This is the whole of Acron’s “stereo sound will not be spatialized” – see the note above for why the downmix is a mean.