# Audio Middleware Backend

## Source Of Truth

Task `TODOS.phase-72.72.22.1.13` adds optional Wwise and FMOD backend mappings
in `V2Audio` without changing the launch runtime decision. The default runtime
policy remains MetaSounds plus AudioModulation; middleware profiles are disabled
by default, ADR-gated, licensing-gated, and cook-safe when external banks are
absent.

The contract is
`V2/ue/Content/V2/Audio/AudioMiddlewareBackend_V2_Contract.json`. Focused
automation is `V2.Audio.MiddlewareBackend.AssetContract`, with module-level
coverage in `V2.Audio.Module`.

## Backend Catalog

`FV2AudioMiddlewareBackendCatalog` stores optional backend profiles for
`EV2AudioMiddlewareBackend::Wwise` and `EV2AudioMiddlewareBackend::FMOD`. Each
`FV2AudioMiddlewareBackendProfile` declares streamed, externally generated
`FV2AudioMiddlewareBankSpec` entries and `FV2AudioMiddlewareEventMapping` rows
for adaptive music states, transitions, and layer assignments.
`EV2AudioMiddlewareEventKind`, `FV2AudioMiddlewareEventRequest`, and
`FV2ResolvedAudioMiddlewareEvent` drive preview and subsystem resolution.

Blueprint helpers:

- `BuildDefaultAudioMiddlewareBackendCatalog`
- `ValidateAudioMiddlewareBackendCatalog`
- `ResolveAudioMiddlewareEvent`

Subsystem integration:

- `RegisterAudioMiddlewareBackendCatalog`
- `ResolveAudioMiddlewareEvent`

## Runtime Behavior

The default catalog mirrors V2 adaptive music decisions into middleware event
names while preserving native fallback. Example mappings include
`Audio.Middleware.Mapping.Wwise.Transition.ExplorationToTension` to
`Wwise.Event.MusicTransition.ExplorationToTension` and
`Audio.Middleware.Mapping.FMOD.Layer.Tension.Strings` to
`FMOD.Event.MusicLayer.Tension.Strings`.

Runtime snapshots expose profile count, Wwise/FMOD registration, native
fallback, disabled-by-default backend status, state/transition/layer mapping
coverage, and the last resolved middleware mapping/event.

## Validation Commands

Run the focused and adjacent checks:

```bash
python3 V2/ue/Tools/check-v2-audio-middleware-backend.py
python3 V2/ue/Tools/check-v2-audio-runtime-policy.py
python3 V2/ue/Tools/check-v2-audio-module.py
python3 V2/ue/Tools/check-v2-ci-workflow.py
python3 V2/ue/Tools/check-v2-buildgraph.py
python3 V2/tools/validate-v2-docs.py
python3 -m json.tool V2/ue/Content/V2/Audio/AudioMiddlewareBackend_V2_Contract.json
```
