DEV505 / START HERE
Managers, libraries, and keys.
Tell the manager which sounds it can play, and generate names you can use in C#.
A Sound Manager is the scene component that runs your sounds. A library is a reusable list of sound events. A key is the name code uses to ask for one of those events.
Start with Your first sound if you have not played Campfire yet.
Register one event
Section titled “Register one event”Open Tools → DEV505 → Sound Manager → Getting Started while outside Play Mode. If the scene is not set up yet, click Set up active scene. Under Register your sounds, drag in your .soundgraph asset and click Register, then save the scene.
You can also select your manager in the Hierarchy and add the event to Sound sources → Direct events in its Inspector. The manager uses the event asset’s filename, without its extension, as the key. Campfire.soundgraph therefore uses Campfire.
The manager reads its event lists when it creates its playback service. Configure them before pressing Play. Editing the arrays in code on an already running manager does not automatically register new events. Advanced code can use the concrete service’s registration methods; most scenes should use the Inspector lists.
Group events in a library
Section titled “Group events in a library”- In the Project window, choose a folder for your audio assets.
- Choose Assets → Create → DEV505 → Sound Manager → Sound Library. Name it
Game sounds. - Select the library. Add entries to its Events list and assign a sound graph to each entry’s sound field.
- Leave an entry’s Key empty to use its asset name, or enter your own name, such as
UI/Confirm. - Select the scene’s Sound Manager. Add
Game soundsto its Libraries list. - Expand the manager’s Event keys to check the result, then regenerate Sound Keys.
You can also create the library with New library in the Getting Started panel. Fill its Events list in the Inspector, then return to the panel, choose the library beside Register, and click Register. Creating a library alone does not register it. Save the scene after registration.
The panel avoids adding the same asset again. If an event already belongs to a registered library, registering that event through the panel keeps its existing library key.
A library does not play sounds itself. The manager reads it and prepares its clips. You can reuse the same library in different scenes.
Keep names predictable
Section titled “Keep names predictable”Keys are case-sensitive: UI/Confirm and ui/confirm are different. A slash is a naming convention; it does not create a folder or a separate playback system.
A library key lets you rename the event asset without changing the name your code uses. If the key is empty, renaming the asset changes its fallback key. Regenerate names and update references after such a rename.
The same event listed more than once is collected once, using its first entry. Direct events are collected before libraries. To use a library’s custom key, remove that event from Direct events instead of registering it in both places. If two different events use the same key, the first keeps it and the manager reports a diagnostic for the collision.
Generate code names
Section titled “Generate code names”Use Tools → DEV505 → Sound Manager → Generate Sound Keys after adding or renaming an event, library key, or graph parameter. The Getting Started panel has a Generate sound keys button, and the manager Inspector has Generate Sounds class under Event keys.
The generated files are in Assets/DEV505/SoundManager.Generated:
| File | What it gives you |
|---|---|
Sounds.cs |
SoundKey fields such as Sounds.Campfire. |
SoundParameters.cs |
Parameter IDs grouped by event, such as SoundParameters.Campfire.Intensity. |
DEV505.SoundManager.Generated.asmdef |
The Unity assembly definition for these files. |
The generator scans valid project events and library entries, not only the open scene. A generated key can exist even when the current manager has not registered it. Check the actual generated field for keys containing spaces or punctuation; the generator makes a valid C# identifier.
Do not edit generated files by hand. Change the asset or library, then regenerate. The next generation replaces manual edits.
Understand when the manager is ready
Section titled “Understand when the manager is ready”The Getting Started panel’s events ready count shows how many event entries the scene’s manager has collected. It does not mean their audio has loaded or that every graph can play.
The manager creates its service and registers events in Awake, an early Unity setup callback. It begins loading clips in Start. Plays admitted before their clips are ready wait in a limited queue. A missing manager does not keep requests for later.
The manager’s Ready property reports that its catalogue has no events still waiting in the preparation list. It is not proof that every event can play: an event with a missing clip can report MissingClip even when Ready is true. You can request a registered play before readiness and check its returned result; each play checks its own required clips.
Disabling or destroying the manager stops its service and all its sounds. Keep on load keeps the manager GameObject when another scene loads. Keep it on a root GameObject, and avoid adding a second active manager in the new scene.
See component settings and results and playback limits for the next checks.