SfxPlayers

from acron.audio import SfxPlayers
class SfxPlayers(base, res=None, voices: int = 5, master: float = 1.0, loader=None)

Bases: object

Godot game scripts’ polyphonic SFX pattern: a bank of voices sibling one-shot AudioStreamPlayer``s where ``play uses the FIRST idle voice and a saturated bank DROPS the sound (that voice-limit behaviour is part of how the games sound – don’t “fix” it).

Each voice owns its own AudioSound instance per clip, so one file can overlap up to voices times (SoundBank keeps ONE handle per uri and restarts it – monophonic by design). master scales every play; games often bake a global factor (e.g. 0.75) and can live-update the attribute for a volume setting.

Godot quirk, handled sanely rather than verbatim: AudioStreamPlayer REJECTS pitch_scale <= 0 and silently keeps the voice’s previous pitch, so upstream calls that pass 0.0 play at an arbitrary leftover pitch – here they play at 1.0.

loader defaults to base.loader; tests inject a stub.

Inheritance diagram

digraph inheritance3b9eea8607 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "SfxPlayers" [URL="acron.audio.SfxPlayers.html#acron.audio.SfxPlayers",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="Godot game scripts' polyphonic SFX pattern: a bank of ``voices``"]; }