How silentbenjininja/unity-audio-events works
Audio Events for Unity is a decoupled runtime audio system. A game object requests playback or owner cleanup through the static message bus; the scene spawner receives requests, enforces cooldown and concurrency limits, and manages pooled AudioSources. Event assets supply AudioResource and mix settings, including AudioClip or AudioRandomContainer variation. The README also documents source tracking and Unity menu setup. Runtime files are excerpted; the prefab setup link is shown as documented, while no unshown pool internals are inferred.
Main entry points: MB_AudioSourceSpawner.cs Pooled Source Spawner · SO_AudioEvent.cs Audio Event Asset · AudioEventsMessageBus.cs Audio Message Bus · AudioEventsMenuItems.cs Spawner Menu Item
Components 9
Audio Runtime
- Audio Message Bus
Runtime/AudioEventsMessageBus.cs - Pooled Source Spawner
Runtime/MB_AudioSourceSpawner.cs - Audio Source Pool
Runtime/MB_AudioSourceSpawner.cs - Unity AudioSource
Event Assets
- Audio Event Asset
Runtime/SO_AudioEvent.cs - Audio Resource
Unity Setup
- Spawner Menu Item
Editor/AudioEventsMenuItems.cs - Pooled Source Prefab
Prefabs/PooledAudioSource.prefab
Other components
- Gameplay Caller
Connections 11
- Gameplay Caller → Audio Message Bus: requests playback
README.md - Gameplay Caller → Audio Message Bus: requests owner stop
README.md - Audio Message Bus → Pooled Source Spawner: dispatches requests
Runtime/MB_AudioSourceSpawner.cs - Pooled Source Spawner → Audio Source Pool: gets pooled source
Runtime/MB_AudioSourceSpawner.cs - Pooled Source Spawner → Audio Event Asset: applies settings
Runtime/MB_AudioSourceSpawner.cs - Audio Event Asset → Audio Resource: assigns resource
Runtime/SO_AudioEvent.cs - Audio Event Asset → Unity AudioSource: configures source
Runtime/SO_AudioEvent.cs - Pooled Source Spawner → Unity AudioSource: positions and plays
Runtime/MB_AudioSourceSpawner.cs - Pooled Source Spawner → Unity AudioSource: stops tracked audio
Runtime/MB_AudioSourceSpawner.cs - Spawner Menu Item → Pooled Source Spawner: creates component
Editor/AudioEventsMenuItems.cs - Spawner Menu Item → Pooled Source Prefab: loads prefab
Editor/AudioEventsMenuItems.cs