Skip to content

Class AuditySampleSet

The substitution unit for Wave Player content: the entries plus how one is picked (weights ride on the entries; selection policy and avoid-repeat live here because they are tuned to the specific content). What stays on the Wave Player is voice behavior (voice mode, max voices, pitch, gain): the Set is “what plays and how it’s picked”; the player is “how a shot behaves”.

A Set is a plain serializable value - inline on a Wave Player by default (the drop-one-clip flow has zero extra steps), promoted to a shared DarkEffekt.Audity.AuditySampleSetAsset when several graphs or game configs reuse it. At runtime a resolved Set is prepared into a bank (see DarkEffekt.Audity.AudityBank) keyed by content hash, so identical inline copies and asset references share one resident bank.

Declaration
[Serializable]
public sealed class AuditySampleSet

True when at least one entry can produce audio.

Declaration
public bool HasPlayableEntry { get; }
Declaration
public AuditySampleEntry[] entries
Declaration
public AuditySampleSelect selection

Avoid the last N picks (Random and Shuffle draws; ignored by Round Robin).

Declaration
[Range(0, 8)]
public int avoidRepeat
Declaration
public AuditySampleSet Clone()

DarkEffekt.Audity.AuditySampleSet

The canonical widening rule: any playable source promotes to a single-entry Set. Accepts an DarkEffekt.Audity.AuditySampleSetAsset (its Set), an UnityEngine.AudioClip, an DarkEffekt.Audity.AuditySample, or any custom UnityEngine.Audio.IAudioGenerator Object. Returns null (with no warning) for null input; returns null for non-promotable objects (a Sound Graph, say).

Declaration
public static AuditySampleSet FromObject(Object source)

DarkEffekt.Audity.AuditySampleSet

Type Name
UnityEngine.Object source

Content-identity hash over the RESOLVED set: per-entry clip identity, every serialized setting on settings-bearing samples, weight, and selection policy. Serializing the complete sample payload deliberately makes newly added serialized playback settings invalidate an existing bank without requiring a matching hash change. Two Sets with the same resolved content - an asset and an inline copy of it - hash equal, so they share one resident bank. Session-stable only (uses object entity ids), which is all runtime bank identity needs.

Declaration
public ulong ContentHash()

System.UInt64