# chasingimagines/audiosystem architecture

> Architecture diagram of the GitHub repository chasingimagines/audiosystem, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chasingimagines/audiosystem
- Repository: https://github.com/chasingimagines/audiosystem

## Overview

AudioSystem is a Unity package for catalog-driven sound effects and background music. The principal runtime workflow is application code calling the static API, which resolves a sound ID through the catalog database, obtains a pooled emitter, and plays the resource; music uses a separate crossfade manager. The editor provides searchable catalog-backed ID selection. The graph follows the shown API, pooling, and manager calls; the small AudioExtensions implementation was read, but its specific call relationship is not shown in the supplied excerpt.

Main entry points: [`Runtime/AudioSystem.cs`](https://github.com/chasingimagines/audiosystem/blob/master/Runtime/AudioSystem.cs) (AudioSystem API), [`Editor/AudioKeyDrawer.cs`](https://github.com/chasingimagines/audiosystem/blob/master/Editor/AudioKeyDrawer.cs) (Audio Key Drawer), [`Runtime/SoundManager.cs`](https://github.com/chasingimagines/audiosystem/blob/master/Runtime/SoundManager.cs) (Sound Manager), [`Runtime/AudioKey.cs`](https://github.com/chasingimagines/audiosystem/blob/master/Runtime/AudioKey.cs) (AudioKey)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Inspector Authoring"]
  node_drawer["Audio Key Drawer<br/>[AudioKeyDrawer.cs]"]
  node_dropdown["ID Dropdown<br/>[AudioIdDropdown.cs]"]
end

subgraph group_catalogs["Catalog Resolution"]
  node_catalog["Audio Catalog<br/>[AudioCatalog.cs]"]
  node_database[("Audio Database<br/>[AudioDatabase.cs]")]
end

subgraph group_api["Audio API"]
  node_audio_key["AudioKey<br/>[AudioKey.cs]"]
  node_audio_id["AudioId Attribute"]
  node_extensions["Audio Extensions<br/>[AudioExtensions.cs]"]
  node_audio_system["AudioSystem API<br/>[AudioSystem.cs]"]
end

subgraph group_playback["Playback Engines"]
  node_sound_manager["Sound Manager<br/>[SoundManager.cs]"]
  node_emitter["Sound Emitter<br/>[SoundEmitter.cs]"]
  node_music_manager["Music Manager<br/>[MusicManager.cs]"]
  node_singleton["Persistent Singleton"]
end

node_app(("Application Code"))

node_app -->|"plays or stops"| node_audio_system
node_app -->|"uses key"| node_audio_key
node_audio_key -->|"delegates play"| node_audio_system
node_extensions -.->|"uses API"| node_audio_system
node_drawer -->|"opens"| node_dropdown
node_drawer -->|"reads entries"| node_catalog
node_drawer -->|"draws field"| node_audio_key
node_drawer -->|"draws field"| node_audio_id
node_audio_system -->|"looks up IDs"| node_database
node_database -->|"registers entries"| node_catalog
node_audio_system -->|"gets emitter"| node_sound_manager
node_audio_system -->|"controls music"| node_music_manager
node_sound_manager -->|"creates and pools"| node_emitter
node_emitter -->|"returns to pool"| node_sound_manager
node_sound_manager -->|"inherits"| node_singleton
node_music_manager -->|"inherits"| node_singleton

click node_drawer "https://github.com/chasingimagines/audiosystem/blob/master/Editor/AudioKeyDrawer.cs"
click node_dropdown "https://github.com/chasingimagines/audiosystem/blob/master/Editor/AudioIdDropdown.cs"
click node_audio_key "https://github.com/chasingimagines/audiosystem/blob/master/Runtime/AudioKey.cs"
click node_audio_id "https://github.com/chasingimagines/audiosystem/blob/master/Runtime/AudioIdAttribute.cs"
click node_extensions "https://github.com/chasingimagines/audiosystem/blob/master/Runtime/AudioExtensions.cs"
click node_catalog "https://github.com/chasingimagines/audiosystem/blob/master/Runtime/AudioCatalog.cs"
click node_database "https://github.com/chasingimagines/audiosystem/blob/master/Runtime/AudioDatabase.cs"
click node_audio_system "https://github.com/chasingimagines/audiosystem/blob/master/Runtime/AudioSystem.cs"
click node_sound_manager "https://github.com/chasingimagines/audiosystem/blob/master/Runtime/SoundManager.cs"
click node_emitter "https://github.com/chasingimagines/audiosystem/blob/master/Runtime/SoundEmitter.cs"
click node_music_manager "https://github.com/chasingimagines/audiosystem/blob/master/Runtime/MusicManager.cs"
click node_singleton "https://github.com/chasingimagines/audiosystem/blob/master/Runtime/PersistentSingleton.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_drawer,node_dropdown toneBlue
class node_catalog,node_database toneAmber
class node_audio_key,node_audio_id,node_extensions,node_audio_system toneMint
class node_sound_manager,node_emitter,node_music_manager,node_singleton toneRose
class node_app toneIndigo
```

## Components

### Inspector Authoring

- [Audio Key Drawer](https://github.com/chasingimagines/audiosystem/blob/master/Editor/AudioKeyDrawer.cs): `Editor/AudioKeyDrawer.cs`
- [ID Dropdown](https://github.com/chasingimagines/audiosystem/blob/master/Editor/AudioIdDropdown.cs): `Editor/AudioIdDropdown.cs`

### Catalog Resolution

- [Audio Catalog](https://github.com/chasingimagines/audiosystem/blob/master/Runtime/AudioCatalog.cs): `Runtime/AudioCatalog.cs`
- [Audio Database](https://github.com/chasingimagines/audiosystem/blob/master/Runtime/AudioDatabase.cs): `Runtime/AudioDatabase.cs`

### Audio API

- [AudioKey](https://github.com/chasingimagines/audiosystem/blob/master/Runtime/AudioKey.cs): `Runtime/AudioKey.cs`
- [AudioId Attribute](https://github.com/chasingimagines/audiosystem/blob/master/Runtime/AudioIdAttribute.cs): `Runtime/AudioIdAttribute.cs`
- [Audio Extensions](https://github.com/chasingimagines/audiosystem/blob/master/Runtime/AudioExtensions.cs): `Runtime/AudioExtensions.cs`
- [AudioSystem API](https://github.com/chasingimagines/audiosystem/blob/master/Runtime/AudioSystem.cs): `Runtime/AudioSystem.cs`

### Playback Engines

- [Sound Manager](https://github.com/chasingimagines/audiosystem/blob/master/Runtime/SoundManager.cs): `Runtime/SoundManager.cs`
- [Sound Emitter](https://github.com/chasingimagines/audiosystem/blob/master/Runtime/SoundEmitter.cs): `Runtime/SoundEmitter.cs`
- [Music Manager](https://github.com/chasingimagines/audiosystem/blob/master/Runtime/MusicManager.cs): `Runtime/MusicManager.cs`
- [Persistent Singleton](https://github.com/chasingimagines/audiosystem/blob/master/Runtime/PersistentSingleton.cs): `Runtime/PersistentSingleton.cs`

### Other components

- **Application Code**

## Connections

- Application Code → AudioSystem API: plays or stops (evidence: `README.md`)
- Application Code → AudioKey: uses key (evidence: `README.md`)
- AudioKey → AudioSystem API: delegates play (evidence: `Runtime/AudioKey.cs`)
- Audio Extensions → AudioSystem API: uses API (evidence: `Runtime/AudioExtensions.cs`)
- Audio Key Drawer → ID Dropdown: opens (evidence: `Editor/AudioKeyDrawer.cs`)
- Audio Key Drawer → Audio Catalog: reads entries (evidence: `Editor/AudioKeyDrawer.cs`)
- Audio Key Drawer → AudioKey: draws field (evidence: `Editor/AudioKeyDrawer.cs`)
- Audio Key Drawer → AudioId Attribute: draws field (evidence: `Editor/AudioKeyDrawer.cs`)
- AudioSystem API → Audio Database: looks up IDs (evidence: `Runtime/AudioSystem.cs`)
- Audio Database → Audio Catalog: registers entries (evidence: `Runtime/AudioDatabase.cs`)
- AudioSystem API → Sound Manager: gets emitter (evidence: `Runtime/AudioSystem.cs`)
- AudioSystem API → Music Manager: controls music (evidence: `Runtime/AudioSystem.cs`)
- Sound Manager → Sound Emitter: creates and pools (evidence: `Runtime/SoundManager.cs`)
- Sound Emitter → Sound Manager: returns to pool (evidence: `Runtime/SoundEmitter.cs`)
- Sound Manager → Persistent Singleton: inherits (evidence: `Runtime/SoundManager.cs`)
- Music Manager → Persistent Singleton: inherits (evidence: `Runtime/MusicManager.cs`)
