Skip to content

Class AudityBank

The residency registry: prepared Sample Set banks, loaded once, cached, refcounted and kept resident independent of any source - the “load bank → events reference it → unload bank” pattern. Residency is decoupled from binding: a bind against a warm bank is a pointer repoint plus a refcount; only DarkEffekt.Audity.AudityBank.Load(DarkEffekt.Audity.AuditySampleSet) pays the preparation cost. Warm your banks up front (level load, weapon equip screen) and a generic pooled source can rebind per acquire for free.

Identity is a content hash of the resolved Set (entries + trims + selection policy) - two identical inline Sets, or an asset and an inline copy of it, share one resident bank. Two reference sources keep a bank alive: the registry (one per outstanding DarkEffekt.Audity.AudityBank.Load(DarkEffekt.Audity.AuditySampleSet) handle) and playing instances (held from first use until the instance’s realtime side reports the bank fully idle). A released-but-still-referenced bank stays indexed by hash and is re-adopted by a new DarkEffekt.Audity.AudityBank.Load(DarkEffekt.Audity.AuditySampleSet) of the same content.

Main-thread only. Runtime banks prepare in-memory (sampler-tier) PCM; entries whose clips cannot supply PCM (streaming import mode, custom generators) are skipped with a warning - route those through compile-time content instead.

Declaration
public static class AudityBank

Cold-bind handling for the Set-convenience overloads (see DarkEffekt.Audity.AudityColdBindPolicy).

Declaration
public static AudityColdBindPolicy ColdBindPolicy { get; set; }

Prepares (or re-adopts) the resident bank for set and returns a handle holding one registry reference. Prepare-if-cold, repoint-if-warm: a warm content hash returns instantly. Release the handle with DarkEffekt.Audity.AudityBank.Release(DarkEffekt.Audity.AudityBankHandle) when this usage is done - live binds and voices keep the bank alive independently.

Declaration
public static AudityBankHandle Load(AuditySampleSet set)

DarkEffekt.Audity.AudityBankHandle

Type Name
DarkEffekt.Audity.AuditySampleSet set

Widening convenience: promotes a Set asset / clip / sample / generator to a Set and loads it.

Declaration
public static AudityBankHandle Load(Object source)

DarkEffekt.Audity.AudityBankHandle

Type Name
UnityEngine.Object source

True once every entry’s PCM is resident. Cold entries (clips still loading asynchronously) finish here - poll from a coroutine/await loop, or rely on DarkEffekt.Audity.AuditySource’s queue-until-ready bind path.

Declaration
public static bool IsReady(AudityBankHandle handle)

System.Boolean

Type Name
DarkEffekt.Audity.AudityBankHandle handle

Drops the handle’s registry reference. The bank stays resident while any other reference (registry or playing instance) holds it, stays indexed by hash while draining, and frees only when everything lets go.

Declaration
public static void Release(AudityBankHandle handle)
Type Name
DarkEffekt.Audity.AudityBankHandle handle