Skip to content
DEV505 / Sound ManagerDOCUMENTATION

DEV505 / SOUND LAB / 07

A little chaos.

See what happens when a crowd of sounds competes.

At 100% Chaos, the counters show accepted, replaced, and limited requests. The exact totals vary each run; here the cooldown counter is still zero.
Arcade in Unity: sounds compete for space. The real scene controls and status readouts are visible.

At 100% Chaos, the counters show accepted, replaced, and limited requests. The exact totals vary each run; here the cooldown counter is still zero.

In Unity’s Project window, open Assets/DEV505/SoundManager/Samples/07-Arcade/Demo.unity. The supplied scene already has its Sound Manager, event registrations, generated keys, camera, and Audio Listener. Press Play, wait for the demo to be ready, and click the Game view before using the keyboard. If you are setting up a separate scene, follow Your first sound first.

Control Action
1 / 2 / 3 Trigger Zap / Coin / Jackpot.
Space / chaos button Start or stop automatic requests.
Chaos slider Change how busy the automatic requests become.
R / reset control Reset score and result counters.

Tap Zap rapidly, then Coin. Zaps continue as older ones are replaced; coins stop accepting new requests at their overlap limit. Press Jackpot twice quickly: the second request is cooling down. Start automatic chaos and increase its pace to make the different outcomes easy to see.

Each event follows its machine’s sound origin. The listener is fixed near the island, and all three event distance ranges are 4–16 units. Spatial placement tells you which machine is making the sound.

No plays have been requested yet. The scene allows six active voices, so a busy session will soon have to make choices.
Arcade in Unity: the arcade is quiet. The real scene controls and status readouts are visible.

No plays have been requested yet. The scene allows six active voices, so a busy session will soon have to make choices.

A play is one running event. A voice is a recording using a playback slot. Here each event has a simple one-voice playback path, and the scene’s Sound Settings provide six voices.

Event key Allowed plays When that event is full
Sounds.ArcadeZap 3 ReplaceOldest accepts the new zap and cancels the oldest.
Sounds.ArcadeCoin 2 RejectNew refuses the extra request.
Sounds.ArcadeJackpot 1 RejectNew; a 3-second cooldown also limits repeated requests.

The limits add up to six. This setup leaves a slot for the jackpot when zaps and coins reach their own limits. It demonstrates overlap policy and cooldown; it does not demonstrate one event stealing another event’s voice through priority. Jackpot is also protected from voice stealing in its settings, but protection does not create an unlimited voice budget.

ArcadeZap allows three overlapping instances and uses Replace Oldest at the limit. An instance is one running play of the event.
Arcade in Unity: replace an older zap. The saved event values are visible in the Inspector.

ArcadeZap allows three overlapping instances and uses Replace Oldest at the limit. An instance is one running play of the event.

ArcadeCoin allows two overlapping instances and uses Reject New. Existing coin sounds can finish when another request arrives at the limit.
Arcade in Unity: reject an extra coin play. The saved event values are visible in the Inspector.

ArcadeCoin allows two overlapping instances and uses Reject New. Existing coin sounds can finish when another request arrives at the limit.

ArcadeJackpot has a three-second cooldown: requests made too soon after an accepted play are refused.
Arcade in Unity: leave a gap between jackpots. The saved event values are visible in the Inspector.

ArcadeJackpot has a three-second cooldown: requests made too soon after an accepted play are refused.

Random Clip chooses a zap and Random Float varies playback speed. Event limits decide whether a new zap is allowed to start.
Arcade in Unity: zap variations. The graph nodes and their connections are visible.

Random Clip chooses a zap and Random Float varies playback speed. Event limits decide whether a new zap is allowed to start.

Zap chooses a recording through Random Clip with immediate repetition disabled, varies speed, plays it, and ends when it finishes. This adds variety without changing the overlap rule.

The coin graph plays one short reward sound and then ends. Its event settings decide what happens when too many coin plays overlap.
Arcade in Unity: a short coin reward. The graph nodes and their connections are visible.

The coin graph plays one short reward sound and then ends. Its event settings decide what happens when too many coin plays overlap.

The jackpot has a simple play-and-finish graph. Its separate priority, overlap limit, and cooldown settings make it behave differently from the frequent zaps.
Arcade in Unity: the jackpot cue. The graph nodes and their connections are visible.

The jackpot has a simple play-and-finish graph. Its separate priority, overlap limit, and cooldown settings make it behave differently from the frequent zaps.

Coin and Jackpot have short authored playback paths. They do not inspect the scoreboard or decide their score value. Their settings control admission; the graph controls the accepted sound’s playback. There are no exposed parameters or custom signals in these three events.

A single request · excerpt
var result = SoundBus.Play(Sounds.ArcadeCoin, context);
if (result.Accepted)
{
// Count an accepted request.
}
else if (result.Status == SoundPlayStatus.ConcurrencyLimit)
{
// Skip this coin sound: its allowed plays are already occupied.
}

context follows the machine and carries the demo’s owner. A result answers whether this new request was accepted. A replacement is different: the new zap is accepted, while the old zap receives a Cancelled notification with ConcurrencyLimit as its reason. The demo filters notifications by owner before incrementing its replacement counter.

The controller counts Cooldown separately. It groups ConcurrencyLimit and CapacityExceeded as limited requests, and records other failures separately. An accepted request can still fail later, so the notification path also handles Failed. The complete recipe demonstrates these two reporting paths and disposes its subscription on disable.

Score, confetti, cabinet movement, automatic request timing, and the custom HUD counters belong to ArcadeDemo. Sound Manager provides admission results, voice allocation, variation, and lifetime notifications. The counters show what happened; they are not a performance benchmark.

The Sound Manager’s optional Show counters and runtime graph inspection are debugging tools. Updating those editor interfaces during playback can reduce FPS. Turn them off when assessing ordinary runtime performance; there is no universal fixed FPS cost.

  • A replacement still reports Accepted. Check the old play’s notification for the cancellation.
  • A jackpot cannot immediately restart. The cooldown is independent of whether you still hear its previous cue.
  • Protected means unlimited. Protection affects stealing, not registration, event limits, or total capacity.
  • Every refused request is retried each frame. Usually skip a nonessential effect and wait for the next real game action instead of creating a retry storm.

These are the saved graph settings. A play can supply different initial parameter values. Float smoothing is measured in units per second; a rate of 0 applies changes immediately.

Sounds.ArcadeCoin

Position
3D · 4–16 units (minimum–maximum distance)
Overlapping plays
2 · RejectNew
Cooldown
None
Owner loss
Stop
Keep Alive
Off — ends when its work is finished
Voice priority
128

No exposed parameters.

Signals: None authored.

Sounds.ArcadeJackpot

Position
3D · 4–16 units (minimum–maximum distance)
Overlapping plays
1 · RejectNew
Cooldown
3 seconds between accepted requests
Owner loss
Stop
Keep Alive
Off — ends when its work is finished
Voice priority
32 · protected from voice stealing

No exposed parameters.

Signals: None authored.

Sounds.ArcadeZap

Position
3D · 4–16 units (minimum–maximum distance)
Overlapping plays
3 · ReplaceOldest
Cooldown
None
Owner loss
Stop
Keep Alive
Off — ends when its work is finished
Voice priority
160

No exposed parameters.

Signals: None authored.

For the meaning of these settings, see Playback settings. The default numbers above come from the Unity graph audit stored with this documentation.

Open the complete integration recipe for the script, Inspector setup, a short test, and cleanup. Use Play context for initial values and placement, and SoundBus for playback controls.

All Arcade Unity captures includes further states and readable graph details, with steps to reproduce each view.