{"id":51445086,"url":"https://github.com/bitemdev/com.bitemdev.audio-engine","last_synced_at":"2026-07-05T15:30:37.298Z","repository":{"id":362675414,"uuid":"1260261833","full_name":"bitemdev/com.bitemdev.audio-engine","owner":"bitemdev","description":"Designer-friendly Unity audio middleware for centralized sound events, pooled playback, 2D/3D audio, music fades, mixer routing, and no-code testing.","archived":false,"fork":false,"pushed_at":"2026-06-05T11:15:17.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-05T13:08:02.832Z","etag":null,"topics":["audio","audio-engine","audio-manager","gamedev","middleware","sound-design","unity","unity-audio","unity-package","upm"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitemdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-05T10:03:39.000Z","updated_at":"2026-06-05T11:15:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bitemdev/com.bitemdev.audio-engine","commit_stats":null,"previous_names":["bitemdev/com.bitemdev.audio-engine"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bitemdev/com.bitemdev.audio-engine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitemdev%2Fcom.bitemdev.audio-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitemdev%2Fcom.bitemdev.audio-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitemdev%2Fcom.bitemdev.audio-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitemdev%2Fcom.bitemdev.audio-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitemdev","download_url":"https://codeload.github.com/bitemdev/com.bitemdev.audio-engine/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitemdev%2Fcom.bitemdev.audio-engine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35160046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-05T02:00:06.290Z","response_time":100,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","audio-engine","audio-manager","gamedev","middleware","sound-design","unity","unity-audio","unity-package","upm"],"created_at":"2026-07-05T15:30:36.752Z","updated_at":"2026-07-05T15:30:37.283Z","avatar_url":"https://github.com/bitemdev.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BitemDev Audio Engine\n\nCentralized Unity audio middleware for designer-authored sound events.\n\nThis package is meant to sit between the sound designer and the programmer:\n\n- The sound designer creates and tunes `AudioEventDefinition` assets.\n- The programmer calls the `AudioManager` with an event id.\n- Gameplay objects notify the audio system, but they do not own `AudioSource` playback logic.\n\nThe package supports both compact and production-scale projects:\n\n- Compact projects: the camera can be both the audio listener and the gameplay audio reference.\n- Production projects: the camera can be the listener while a dedicated gameplay transform drives audio logic such as proximity, ambience, combat intensity, or music state.\n- Unity version support: the package uses a conservative API baseline and is intended to compile in Unity 6000.0 and later 6000.x releases.\n\n## Architecture Goals\n\nThe package is built around these rules:\n\n| Goal | Package Support |\n| --- | --- |\n| Centralize playback | `AudioManager` owns pooled `AudioSource` voices, event lookup, playback, mixer parameters, snapshots, and stopping. |\n| Keep gameplay code clean | Gameplay code calls the manager with event ids instead of managing `AudioSource` components directly. |\n| Give designers control | `AudioEventDefinition` assets hold clips, routing, randomization, spatial settings, cooldowns, voice limits, and fades. |\n| Route by audio bus | Events choose a bus such as `Sfx`, `Music`, or `Dialogue`; `AudioEngineConfig` maps those buses to mixer groups. |\n| Support camera-based listening | `AudioReferenceRig` assigns/registers the listener camera and can ensure it has an `AudioListener`. |\n| Support separate gameplay audio logic | `AudioReferenceRig` has a separate `Logic Reference` field used by systems such as `AudioDistanceParameterDriver`. |\n| Support compact setups | Set `Reference Mode` to `CameraOnly` when the camera should drive both listening and audio logic. |\n| Support larger setups | Set `Reference Mode` to `SeparateListenerAndLogicReference` when listening and gameplay audio logic should use different transforms. |\n\n## Install From Git URL\n\n1. Open Unity.\n2. Open `Window \u003e Package Manager`.\n3. Press `+`.\n4. Choose `Add package from git URL...`.\n5. Paste: https://github.com/bitemdev/com.bitemdev.audio-engine.git\n6. Wait for Unity to import and compile.\n\nThe package appears under `Packages/BitemDev Audio Engine`.\n\n## Fastest No-Code Test\n\nUse this path when someone wants to install the package in an empty project and verify the whole tool without writing code.\n\n1. Install the package from the Git URL.\n2. Open any scene, including a brand-new empty scene.\n3. Run `Tools \u003e BitemDev \u003e Audio Engine \u003e Create No-Code Demo In Current Scene`.\n4. Press Play.\n5. Use the on-screen `BitemDev Audio Engine Demo` panel.\n\nThe demo creates:\n\n- `AudioEngineConfig.asset`\n- `AudioEventLibrary.asset`\n- Five demo WAV clips generated inside `Assets/AudioEngine/Demo/Clips`\n- Five demo audio events inside `Assets/AudioEngine/Demo/Events`\n- One `AudioManager`\n- One `AudioReferenceRig`\n- One camera listener setup if the scene did not already have one\n- One logic reference object\n- One green cube for 3D one-shot testing\n- One moving cyan sphere for followed loop testing\n- One on-screen no-code test panel\n\nThe on-screen buttons test:\n\n| Button | What It Tests |\n| --- | --- |\n| `Play 2D UI Event` | Direct event-asset playback, 2D playback, pooling. |\n| `Play Event By Id` | Event library lookup using a string id. |\n| `Play 3D Event At Cube` | Positional playback, camera listener, 3D attenuation. |\n| `Start Follow Loop` / `Stop Follow Loop` | Looping playback, follow target behavior, handle-based stopping. |\n| `Music A` / `Music B` | Music playback mode and fade-out replacement. |\n| `Stop All` | Global stop and fade behavior. |\n| `Move follow emitter` | Whether the followed sound updates as its transform moves. |\n\nAfter using the demo, inspect the generated event assets. They are normal `AudioEventDefinition` assets and can be edited, duplicated, renamed, or deleted.\n\n## Empty Project Test\n\nUse these steps when testing the tool manually in a fresh Unity project.\n\n### 1. Create The Default Assets\n\nRun:\n\n`Tools \u003e BitemDev \u003e Audio Engine \u003e Create Default Assets`\n\nUnity creates:\n\n- `Assets/AudioEngine/AudioEngineConfig.asset`\n- `Assets/AudioEngine/AudioEventLibrary.asset`\n\nPurpose:\n\n- `AudioEngineConfig` stores global audio settings.\n- `AudioEventLibrary` is the list of events the programmer can trigger by id.\n\n### 2. Add The Audio Manager\n\nRun:\n\n`GameObject \u003e BitemDev \u003e Audio Engine \u003e Audio Manager`\n\nThis creates a scene object named `Audio Manager`.\n\nPurpose:\n\n- Owns pooled `AudioSource` objects.\n- Plays every event.\n- Routes events to mixer groups.\n- Handles music replacement and fades.\n- Handles cooldowns and max voice limits.\n- Applies mixer parameters and snapshots.\n\nThere should be one `AudioManager` in the project bootstrap path. Runtime duplicates are destroyed, and the GameObject creation menu selects the existing manager instead of creating another one.\n\n### 3. Add The Audio Reference Rig\n\nRun:\n\n`GameObject \u003e BitemDev \u003e Audio Engine \u003e Audio Reference Rig`\n\nSelect the new object and assign:\n\n- `Listener Camera`: your Main Camera.\n- `Logic Reference`: usually the Player object. In an empty test project, create an empty GameObject named `Player Reference` and assign it.\n- `Reference Mode`: choose the setup you want.\n\nReference modes:\n\n| Mode | Use When | What Happens |\n| --- | --- | --- |\n| `CameraOnly` | Compact projects, prototypes, simple scenes | Camera position is used for listening and gameplay audio logic. |\n| `SeparateListenerAndLogicReference` | Projects where camera movement should not drive gameplay audio logic | Camera hears the sound, logic reference drives proximity and parameters. |\n| `Explicit` | Advanced/manual setups | Uses exactly the transforms assigned by code or rig. |\n\nUse `SeparateListenerAndLogicReference` when camera framing, zoom, or cinematic movement should not affect gameplay audio behavior.\n\nUse `CameraOnly` when the camera is the only meaningful listener/reference point in the scene.\n\n### 4. Create A Test Audio Event\n\nOpen:\n\n`Tools \u003e BitemDev \u003e Audio Engine \u003e Open Audio Engine Window`\n\nIn the window:\n\n1. Assign `AudioEventLibrary.asset` if it is not already assigned.\n2. Set `Events Folder` to `Assets/AudioEngine/Events`.\n3. Set `Event Id` to `ui.test-click`.\n4. Press `Create Event Asset`.\n5. Select the created event asset.\n6. In `Clips`, set size to `1`.\n7. Assign any short `AudioClip`.\n\nPress Play in Unity. Select the event asset. Press:\n\n`Play Through Audio Manager`\n\nIf the event has a clip and an `AudioManager` exists in the scene, you should hear it.\n\n### 5. Generate Programmer Constants\n\nOpen:\n\n`Tools \u003e BitemDev \u003e Audio Engine \u003e Open Audio Engine Window`\n\nPress:\n\n`Generate AudioEventIds.cs`\n\nThis creates:\n\n`Assets/AudioEngine/Generated/AudioEventIds.cs`\n\nExample generated constant:\n\n```csharp\npublic const string UI_TEST_CLICK = \"ui.test-click\";\n```\n\nThe programmer can now use the constant instead of typing strings.\n\n## Main Workflow\n\n### Sound Designer\n\n1. Create event assets.\n2. Assign clips.\n3. Tune volume, pitch, randomization, spatial settings, cooldowns, and voice limits.\n4. Validate the library.\n5. Generate constants.\n6. Tell the programmer which event ids should be triggered from gameplay.\n\n### Programmer\n\n1. Put one `AudioManager` in the bootstrap scene.\n2. Put one `AudioReferenceRig` in the scene.\n3. Call the manager from gameplay code.\n4. Do not put direct `AudioSource.Play()` logic in gameplay scripts unless there is a very specific reason.\n\n## Event Id Naming\n\nUse stable, readable ids. Recommended format:\n\n```text\ncategory.object.action\n```\n\nExamples:\n\n```text\nui.confirm\nui.cancel\nsfx.player.footstep\nsfx.enemy.hit\nsfx.weapon.shot\nambience.forest.loop\nmusic.combat\ndialogue.npc.greeting\n```\n\nAvoid renaming event ids after programmers start using them. Renaming an id requires updating code or regenerating constants.\n\n## Audio Event Definition\n\nCreate from:\n\n`Create \u003e BitemDev \u003e Audio Engine \u003e Audio Event`\n\nOr use the Audio Engine window.\n\nPurpose:\n\nAn `AudioEventDefinition` is one playable sound event. It can contain one clip or several variations.\n\n### Top Fields\n\n| Field | Purpose | Example |\n| --- | --- | --- |\n| `Event Id` | Stable id used by code and generated constants. | `sfx.player.jump` |\n| `Category` | Organizational label. Also drives `Bus: Auto` routing. | `Sfx`, `Music`, `Ambience`, `Dialogue`, `Ui` |\n| `Bus` | Mixer routing layer. `Auto` infers from playback mode/category. | `Sfx`, `Music`, `Dialogue` |\n| `Playback Mode` | How the event behaves. | `OneShot`, `Loop`, `Music` |\n| `Spatial Mode` | Whether the event is 2D or 3D. | UI = `TwoD`, explosion = `World3D` |\n| `Output Mixer Group` | Optional per-event routing override. Leave empty to use the event bus. | Special one-off mixer group |\n| `Clip Selection Mode` | How to pick clips from the list. | `Random` or `Sequential` |\n| `Clips` | AudioClip variations. | 5 footstep clips |\n\n### Clip Entries\n\nEach clip entry has:\n\n| Field | Purpose |\n| --- | --- |\n| `Clip` | The actual `AudioClip`. |\n| `Weight` | Random selection weight. Higher means more likely. Only used in `Random` mode. |\n| `Volume` | Per-clip volume multiplier. Useful when one variation is louder. |\n| `Pitch` | Per-clip pitch multiplier. Useful when one variation needs correction. |\n\nExample:\n\n- Footstep 1 weight `1`\n- Footstep 2 weight `1`\n- Footstep 3 weight `0.5`\n\nFootstep 3 plays less often.\n\n### Playback Fields\n\n| Field | Purpose | Recommended Use |\n| --- | --- | --- |\n| `Volume` | Base event volume. | Start at `1`, lower if needed. |\n| `Pitch` | Base pitch. | Keep `1` unless designing variation. |\n| `Random Volume` | Adds random volume offset. | Footsteps, cloth, impacts. |\n| `Random Pitch` | Adds random pitch offset. | Footsteps, impacts, repeated UI sounds. |\n| `Priority` | Unity voice priority. Lower number is more important. | Music/dialogue lower number, tiny debris higher number. |\n| `Ignore Listener Pause` | Plays even when `AudioListener.pause` is true. | Pause menu UI. |\n| `Delay` | Starts playback after seconds. | Delayed stingers. |\n| `Fade In Seconds` | Fades in when starting. | Music, ambience loops. |\n| `Fade Out Seconds` | Default fade when stopped/replaced. | Music, ambience loops. |\n\n### Stop Fields\n\n| Field | Purpose | Recommended Use |\n| --- | --- | --- |\n| `Stop Event` | Optional event to play when this event is explicitly stopped. | Loop tail, button release, music stop sting. |\n| `Stop Event Id` | Optional id lookup for the stop event when a direct asset reference is not convenient. | Generated/id-driven workflows. |\n\nExplicit stops use `Fade Out Seconds` by default. Use this for loops and music to avoid pops and clicks.\n\n### 3D Fields\n\nOnly matter when `Spatial Mode` is not `TwoD`.\n\n| Field | Purpose | Recommended Use |\n| --- | --- | --- |\n| `Spatial Blend` | `0` = 2D, `1` = full 3D. | Usually `1` for world sounds. |\n| `Min Distance` | Full volume range. | `1` to `3` for small sounds. |\n| `Max Distance` | Distance where attenuation stops. | Depends on scene scale. |\n| `Rolloff Mode` | Distance attenuation curve. | `Logarithmic` is a good default. |\n| `Doppler Level` | Pitch shift from movement. | Use carefully. Often `0` or low in stylized games. |\n| `Spread` | Stereo spread for 3D source. | Usually `0` for point sounds. |\n| `Reverb Zone Mix` | How much the source feeds reverb zones. | `1` default. |\n| `Spatialize` | Enables Unity spatializer plugin if configured. | Only if project uses a spatializer. |\n\n### Voice Management Fields\n\n| Field | Purpose | Example |\n| --- | --- | --- |\n| `Max Voices` | Maximum simultaneous voices for this event. `0` means unlimited until pool limit. | Footsteps = `4`, gunshot = `8` |\n| `Voice Limit Behavior` | What to do when max voices is reached. | Reject new or steal oldest. |\n| `Cooldown Seconds` | Minimum time between plays for this event. | UI spam prevention, rapid footsteps. |\n| `Stop When Follow Target Is Destroyed` | Stops followed loops when their owner disappears. | Engine loop following a vehicle. |\n\n## Examples\n\n### Example 1: UI Click\n\nUse for menu selection, buttons, pause screen.\n\nEvent settings:\n\n```text\nEvent Id: ui.click\nCategory: Ui\nPlayback Mode: OneShot\nSpatial Mode: TwoD\nClip Selection Mode: Random\nVolume: 1\nRandom Pitch: 0.03\nIgnore Listener Pause: true\nMax Voices: 4\nCooldown Seconds: 0.02\n```\n\nProgrammer call:\n\n```csharp\nAudioManager.Instance.Play(AudioEventIds.UI_CLICK);\n```\n\n### Example 2: 3D Explosion\n\nUse for a world sound at a specific position.\n\nEvent settings:\n\n```text\nEvent Id: sfx.explosion.large\nCategory: Sfx\nPlayback Mode: OneShot\nSpatial Mode: World3D\nSpatial Blend: 1\nMin Distance: 2\nMax Distance: 80\nRolloff Mode: Logarithmic\nRandom Pitch: 0.05\nMax Voices: 6\nVoice Limit Behavior: StealOldest\n```\n\nProgrammer call:\n\n```csharp\nAudioManager.Instance.PlayAt(AudioEventIds.SFX_EXPLOSION_LARGE, explosionPosition);\n```\n\n### Example 3: Player Footsteps\n\nUse several clip variations and call from animation events or movement code.\n\nEvent settings:\n\n```text\nEvent Id: sfx.player.footstep\nCategory: Sfx\nPlayback Mode: OneShot\nSpatial Mode: World3D\nClip Selection Mode: Random\nRandom Volume: 0.08\nRandom Pitch: 0.06\nMin Distance: 1\nMax Distance: 18\nMax Voices: 4\nCooldown Seconds: 0.05\n```\n\nProgrammer call:\n\n```csharp\nAudioManager.Instance.PlayAt(AudioEventIds.SFX_PLAYER_FOOTSTEP, transform.position);\n```\n\nDesigner-only scene test:\n\n1. Add `AudioEmitter` to the player.\n2. Assign the footstep event.\n3. Leave `Follow Transform` off.\n4. Call `AudioEmitter.Play()` from an animation event.\n\n### Example 4: Vehicle Engine Loop\n\nUse for a sound that follows an object and keeps playing.\n\nEvent settings:\n\n```text\nEvent Id: sfx.vehicle.engine-loop\nCategory: Sfx\nPlayback Mode: Loop\nSpatial Mode: World3D\nFade In Seconds: 0.2\nFade Out Seconds: 0.3\nStop When Follow Target Is Destroyed: true\n```\n\nProgrammer call:\n\n```csharp\nprivate AudioPlaybackHandle engineSound;\n\nprivate void OnEnable()\n{\n    engineSound = AudioManager.Instance.PlayFollow(AudioEventIds.SFX_VEHICLE_ENGINE_LOOP, transform);\n}\n\nprivate void OnDisable()\n{\n    engineSound.Stop();\n}\n```\n\n### Example 5: Music Track\n\nUse `Playback Mode: Music` so starting a new music event fades out the current music voice.\n\nEvent settings:\n\n```text\nEvent Id: music.combat\nCategory: Music\nBus: Auto\nPlayback Mode: Music\nSpatial Mode: TwoD\nFade In Seconds: 1\nFade Out Seconds: 1\n```\n\nProgrammer call:\n\n```csharp\nAudioManager.Instance.Play(AudioEventIds.MUSIC_COMBAT);\n```\n\n### Example 6: Ambience Zone\n\nUse an `AudioZone` to change ambience or mixer state when the player enters a trigger.\n\nSteps:\n\n1. Create a GameObject named `Forest Audio Zone`.\n2. Add a `Box Collider`.\n3. Enable `Is Trigger`.\n4. Add `AudioZone`.\n5. Set `Required Tag` to `Player` if your player uses that tag.\n6. Assign an `Enter Event`, `Exit Event`, snapshots, or mixer parameter values.\n\nWhen the matching object enters the trigger, the zone applies enter audio. When the last matching object exits, it applies exit audio.\n\n## Runtime Components\n\n### AudioManager\n\nAdd from:\n\n`GameObject \u003e BitemDev \u003e Audio Engine \u003e Audio Manager`\n\nPurpose:\n\nThe central playback system. This should be the only object that creates and controls pooled runtime `AudioSource` voices.\n\nFields:\n\n| Field | Purpose |\n| --- | --- |\n| `Config` | Optional `AudioEngineConfig` asset. Recommended. |\n| `Event Library` | Library used for string/id lookup. Usually assigned from config. |\n| `Master Mixer` | Mixer used when setting parameters without a specific mixer. |\n| `Bus Bindings` | Optional local bus-to-mixer-group bindings. Usually assigned from config. |\n| `Reference Mode` | Camera-only or separate listener/logic reference. Usually assigned by config or rig. |\n| `Listener Transform` | Transform used as the listener reference. Usually camera. |\n| `Logic Reference Transform` | Transform used for gameplay audio logic. Usually player. |\n| `Initial Pool Size` | Number of pooled audio voices created at startup. |\n| `Max Pool Size` | Hard cap for pooled voices. |\n| `Allow Pool Growth` | Allows pool to grow from initial to max. |\n| `Dont Destroy On Load` | Keeps the manager across scenes. |\n| `Use Main Camera Fallback` | Uses `Camera.main` if no listener was assigned. |\n\nCommon programmer methods:\n\n```csharp\nAudioManager.Instance.Play(\"ui.click\");\nAudioManager.Instance.PlayAt(\"sfx.explosion.large\", position);\nAudioManager.Instance.PlayFollow(\"sfx.vehicle.engine-loop\", transform);\nAudioManager.Instance.StopEvent(\"ambience.forest.loop\");\nhandle.Stop(); // Uses that event's Fade Out Seconds.\nhandle.Stop(0.25f); // Overrides the fade for this stop.\nAudioManager.Instance.StopAll();\nAudioManager.Instance.SetConfiguredVolume(\"Master\", 0.8f);\n```\n\n### AudioReferenceRig\n\nAdd from:\n\n`GameObject \u003e BitemDev \u003e Audio Engine \u003e Audio Reference Rig`\n\nPurpose:\n\nConnects the scene camera and logic reference to the manager.\n\nFields:\n\n| Field | Purpose |\n| --- | --- |\n| `Reference Mode` | Chooses camera-only or dual-reference behavior. |\n| `Listener Camera` | Camera that should hold the `AudioListener`. |\n| `Logic Reference` | Player/reference transform used for gameplay audio logic. |\n| `Ensure Audio Listener On Camera` | Adds an `AudioListener` to the camera if missing. |\n\nImportant:\n\nUnity should only have one active `AudioListener` in a scene. If multiple cameras have listeners, disable or remove the extras.\n\n### AudioEmitter\n\nAdd manually to a scene object.\n\nPurpose:\n\nA small designer-friendly component that notifies `AudioManager` without custom code. Useful for props, animation events, timeline events, triggers, or quick tests.\n\nFields:\n\n| Field | Purpose |\n| --- | --- |\n| `Audio Event` | Direct event asset reference. Preferred for scene objects. |\n| `Event Id` | String id fallback if no asset is assigned. |\n| `Play On Start` | Plays once when the object starts. |\n| `Play On Enable` | Plays when the object is enabled after Start. |\n| `Follow Transform` | If true, the sound follows this GameObject. Good for loops. |\n| `Volume Scale` | Per-emitter volume multiplier. |\n| `Pitch Scale` | Per-emitter pitch multiplier. |\n\nPublic methods:\n\n```csharp\nPlay()\nStop()\n```\n\nThese can be called from UnityEvents or animation events.\n\n### AudioZone\n\nPurpose:\n\nTrigger area that applies audio changes when matching objects enter or exit.\n\nFields:\n\n| Field | Purpose |\n| --- | --- |\n| `Trigger Layers` | Which layers can activate the zone. |\n| `Required Tag` | Optional tag filter, such as `Player`. |\n| `Enter Event` | Event played when the first matching object enters. |\n| `Exit Event` | Event played when the last matching object exits. |\n| `Enter Snapshot` | Audio Mixer snapshot transitioned to on enter. |\n| `Exit Snapshot` | Audio Mixer snapshot transitioned to on exit. |\n| `Snapshot Transition Seconds` | Transition time for snapshots. |\n| `Enter Parameters` | Mixer parameters applied on enter. |\n| `Exit Parameters` | Mixer parameters applied on exit. |\n\nWorks with 3D colliders and 2D colliders.\n\n### AudioDistanceParameterDriver\n\nPurpose:\n\nWrites a distance-based value into an exposed Audio Mixer parameter.\n\nThis component supports gameplay-driven audio logic. It measures distance from the manager's logic reference, not necessarily the camera.\n\nFields:\n\n| Field | Purpose |\n| --- | --- |\n| `Target` | Object being measured. If empty, uses this transform. |\n| `Mixer` | Mixer that owns the exposed parameter. If empty, uses manager master mixer. |\n| `Exposed Parameter` | Name of the exposed mixer parameter. |\n| `Value Mode` | Raw value, linear volume converted to dB, or direct dB. |\n| `Max Distance` | Distance that maps to the end of the 0-1 range. |\n| `Invert` | If true, close = `1`, far = `0`. |\n| `Update Interval` | Time between parameter updates. |\n\nExample:\n\n- Enemy near player = combat intensity close to `1`.\n- Enemy far from player = combat intensity close to `0`.\n- In `CameraOnly` mode, distance is measured from the camera.\n- In `SeparateListenerAndLogicReference` mode, distance is measured from the assigned logic reference.\n\n## Designer Assets\n\n### AudioEventLibrary\n\nPurpose:\n\nList of all event assets that can be played by id.\n\nThe manager uses this to resolve:\n\n```csharp\nAudioManager.Instance.Play(\"sfx.player.jump\");\n```\n\nIf an event is not in the library, string/id playback will fail and log a warning.\n\n### AudioEngineConfig\n\nPurpose:\n\nProject-level audio policy for the central manager.\n\nFields:\n\n| Field | Purpose |\n| --- | --- |\n| `Event Library` | Main library used by the manager. |\n| `Master Mixer` | Default mixer for parameter writes and bus-name routing fallback. |\n| `Bus Bindings` | Maps `Sfx`, `Music`, `Dialogue`, `Ambience`, `Ui`, and `Master` buses to `AudioMixerGroup` outputs. |\n| `Reference Mode` | Default reference mode. |\n| `Initial Pool Size` | Startup voice count. |\n| `Max Pool Size` | Maximum voice count. |\n| `Allow Pool Growth` | Allows voice pool to grow when busy. |\n| `Dont Destroy On Load` | Keeps audio manager alive across scenes. |\n| `Use Main Camera Fallback` | Uses `Camera.main` if no listener is assigned. |\n| `Volume Bindings` | Named mixer volume controls for settings menus. |\n\nRouting order:\n\n1. If an event has `Output Mixer Group`, that group is used.\n2. Otherwise the event `Bus` is resolved.\n3. If `Bus` is `Auto`, music playback routes to `Music`; otherwise category maps to the matching bus.\n4. `AudioEngineConfig.Bus Bindings` provides the final `AudioMixerGroup` when assigned.\n5. If no binding is assigned, the manager searches the `Master Mixer` for a group named after the bus, such as `Sfx`/`SFX`, `Music`, `Ambience`, `Dialogue`, `Ui`/`UI`, or `Master`.\n6. If no mixer group is found, Unity plays the source without mixer routing and the manager logs a warning once for that bus.\n\nVolume binding example:\n\n```text\nLabel: Master\nMixer: MainAudioMixer\nExposed Parameter: MasterVolume\nDefault Linear Volume: 1\n```\n\nProgrammer call:\n\n```csharp\nAudioManager.Instance.SetConfiguredVolume(\"Master\", 0.75f);\n```\n\nThe manager converts linear volume to decibels correctly.\n\n## Programmer Integration\n\nRecommended usage:\n\n```csharp\nusing BitemDev.AudioEngine;\nusing BitemDev.AudioEngine.Generated;\nusing UnityEngine;\n\npublic sealed class ExampleAudioCaller : MonoBehaviour\n{\n    public void Confirm()\n    {\n        AudioManager.Instance.Play(AudioEventIds.UI_CONFIRM);\n    }\n\n    public void Explode(Vector3 position)\n    {\n        AudioManager.Instance.PlayAt(AudioEventIds.SFX_EXPLOSION_LARGE, position);\n    }\n}\n```\n\nFor looping sounds:\n\n```csharp\nusing BitemDev.AudioEngine;\nusing BitemDev.AudioEngine.Generated;\nusing UnityEngine;\n\npublic sealed class EngineAudio : MonoBehaviour\n{\n    private AudioPlaybackHandle handle;\n\n    private void OnEnable()\n    {\n        handle = AudioManager.Instance.PlayFollow(AudioEventIds.SFX_VEHICLE_ENGINE_LOOP, transform);\n    }\n\n    private void OnDisable()\n    {\n        handle.Stop();\n    }\n}\n```\n\nAvoid this in gameplay code:\n\n```csharp\nGetComponent\u003cAudioSource\u003e().Play();\n```\n\nPrefer this:\n\n```csharp\nAudioManager.Instance.PlayAt(AudioEventIds.SFX_PLAYER_FOOTSTEP, transform.position);\n```\n\n## Audio Mixer Setup\n\nThe package works without an Audio Mixer, but a production project should use one.\n\nRecommended mixer groups:\n\n```text\nMaster\nMaster/SFX\nMaster/Music\nMaster/Ambience\nMaster/Dialogue\nMaster/UI\n```\n\nRecommended exposed volume parameters:\n\n```text\nMasterVolume\nSfxVolume\nMusicVolume\nAmbienceVolume\nDialogueVolume\nUiVolume\n```\n\nIn Unity's Audio Mixer:\n\n1. Create the groups.\n2. Expose each group volume parameter.\n3. Open `AudioEngineConfig`.\n4. Assign each mixer group in `Bus Bindings`.\n5. Add volume bindings in `AudioEngineConfig`.\n\nUse `AudioEventDefinition.Output Mixer Group` only for special one-off routing. Normal SFX, Music, Dialogue, Ambience, and UI events should use the event `Bus`.\n\n## Validation Checklist\n\nBefore giving events to the programmer:\n\n1. Open `Tools \u003e BitemDev \u003e Audio Engine \u003e Open Audio Engine Window`.\n2. Press `Validate Library`.\n3. Fix missing clips.\n4. Fix duplicate event ids.\n5. Generate `AudioEventIds.cs`.\n6. Enter Play Mode and use `Play Through Audio Manager` on a few events.\n\nScene checklist:\n\n1. One active `AudioManager`.\n2. One active `AudioListener`.\n3. `AudioReferenceRig.Listener Camera` assigned.\n4. `AudioReferenceRig.Logic Reference` assigned for dual-reference projects.\n5. `AudioManager.Config` assigned.\n6. `AudioEngineConfig.Event Library` assigned.\n\n## Troubleshooting\n\n### I press Play Through Audio Manager but hear nothing\n\nCheck:\n\n1. Unity is in Play Mode.\n2. The scene has an `AudioManager`.\n3. The event has at least one clip.\n4. The clip volume and event volume are not `0`.\n5. The Audio Mixer group is not muted.\n6. There is one active `AudioListener`.\n\n### Programmer calls an event id but nothing plays\n\nCheck:\n\n1. The event asset is in `AudioEventLibrary`.\n2. The id in code matches the event id exactly.\n3. `AudioManager.Event Library` or `AudioEngineConfig.Event Library` is assigned.\n4. `Validate Library` has no duplicate id warnings.\n\n### 3D sounds play like 2D sounds\n\nCheck:\n\n1. Event `Spatial Mode` is `World3D`.\n2. `Spatial Blend` is close to `1`.\n3. The programmer is using `PlayAt` or `PlayFollow`, not plain `Play`.\n4. The listener camera has the active `AudioListener`.\n\n### 3D sounds are too quiet or disappear too fast\n\nIncrease:\n\n- `Min Distance`\n- `Max Distance`\n- Event `Volume`\n\nAlso check the assigned Audio Mixer group volume.\n\n### Camera movement changes gameplay audio behavior\n\nFor projects where camera movement should not drive gameplay audio logic, set:\n\n```text\nAudioReferenceRig.Reference Mode = SeparateListenerAndLogicReference\nAudioReferenceRig.Listener Camera = Main Camera\nAudioReferenceRig.Logic Reference = Player\n```\n\nFor compact projects where camera position should drive everything, set:\n\n```text\nAudioReferenceRig.Reference Mode = CameraOnly\n```\n\n### Unity warns about multiple AudioListeners\n\nOnly one camera should have an active `AudioListener`. Remove or disable extra listeners.\n\n## Feedback To Send Back\n\nWhen testing the package, useful feedback includes:\n\n1. Which Unity version was used.\n2. Whether installation from Git URL worked.\n3. Whether the default asset creation was clear.\n4. Whether creating and previewing events was clear.\n5. Whether field names made sense.\n6. Whether any setup step felt missing.\n7. Whether the camera/player reference modes match the desired workflow.\n8. What extra designer controls would save time.\n\n## Current Scope\n\nIncluded:\n\n- Central audio manager.\n- Event assets.\n- Event library.\n- Runtime pooling.\n- 2D and 3D playback.\n- Followed loop playback.\n- Music replacement with fade-out.\n- Cooldowns and per-event max voices.\n- Bus-based mixer routing.\n- Mixer parameter setting.\n- Snapshot transitions.\n- Camera-only and separate listener/logic reference modes.\n- Designer setup window.\n- Library validation.\n- Generated event id constants.\n\nNot included yet:\n\n- Timeline clips.\n- FMOD/Wwise integration.\n- Custom waveform preview.\n- Import preset automation for audio files.\n- Save-file persistence for user volume settings.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitemdev%2Fcom.bitemdev.audio-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitemdev%2Fcom.bitemdev.audio-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitemdev%2Fcom.bitemdev.audio-engine/lists"}