Namespace Serenity.SoundMixer.Infrastructure.AudioMixerEffectLoop.Editor
Classes
AudioMixerEffectLoopCreator
Editor-only service that performs the actual AudioMixer modification for an "effect loop" group. Contains NO UI code — it takes a CreateAudioMixerEffectLoopInput and returns a CreateAudioMixerEffectLoopOutput, so it can be unit-driven or reused independently of the EditorWindow.
What it builds. Under the chosen parent group it creates one new group whose effect chain is, in order:
- Receive — the routing destination (added at index 0).
- the user's selected effects, in the exact requested order.
- Attenuation — the group's wet/output volume stage. This is created automatically by
Unity's
CreateNewGroupflow and is intentionally LEFT as the final stage; a second Attenuation is never added.
Routing usage (Receive side only). This tool builds only the RECEIVE side of a Send/Receive loop. It never modifies any group other than the new loop group and its parent link. To route audio into the loop, the user must afterwards select a source group (e.g. SFX or Voice) in the Audio Mixer window, add a Send effect to it, and point that Send at this loop group's Receive. The source Send's wet level controls how much signal is routed in; this loop's trailing Attenuation controls the overall returned wet level. Automatic Send wiring is deliberately out of scope (a possible future feature).
Failure policy. Never throws to the caller: all errors (including internal-API reflection failures) are returned as a failed CreateAudioMixerEffectLoopOutput so the UI can show a clear message. Nothing fails silently.
AudioMixerEffectLoopReflectionException
Raised when the internal Unity AudioMixer API cannot be reached as expected — almost always because the (undocumented) internal API changed in a Unity version. The message always names the running Unity version so maintainers can pinpoint the break.
AudioMixerEffectLoopSyncService
Editor-only engine that makes the AudioMixer match an effect-loop DEFINITION (the source of truth):
for every Source group it ensures a Send into the loop's Receive exists and its level is exposed as
{Source}_{Loop}_Send — writing the resolved exposed-parameter names back onto the definition.
The loop's own output level is left as a static mixer setting (not exposed). Idempotent/additive: it never removes
anything and skips what already exists. Reads mixer structure via YAML (UnityYamlUtils),
writes via Serenity.SoundMixer.Infrastructure.AudioMixerEffectLoop.Editor.AudioMixerEffectLoopReflectionAdapter. Never throws to the caller.
AudioMixerEffectLoopSyncService.SyncReport
Per-definition sync outcome.
AudioMixerYamlReader
Editor-only reader for AudioMixer (.mixer) assets via their YAML representation. Keeps all knowledge of the AudioMixer's serialized shape (AudioMixerController / AudioMixerGroupController, m_Children, m_Effects, m_ExposedParameters, m_Volume, ...) inside the SoundMixer module instead of the generic UnityYamlUtils. Reads only; never mutates.
A Unity YAML asset is a stream of object documents (--- !u!<tag> &<fileID>,
then <TypeName>: { fields }); references between objects are mappings {fileID: X}.
Unity exposes no public API to read this structure, so it is parsed directly.
CreateAudioMixerEffectLoopWindow
Editor tool (Tools > Serenity > Audio > Create Audio Mixer Effect Loop) for building an
AudioMixer "effect loop" group: a child group whose chain is
Receive -> user effects (in order) -> Attenuation, ready to be used as a Send/Receive
routing destination.
Separation of concerns. This window only collects input and renders results. All AudioMixer modification lives in AudioMixerEffectLoopCreator, and every internal Unity API call is isolated in Serenity.SoundMixer.Infrastructure.AudioMixerEffectLoop.Editor.AudioMixerEffectLoopReflectionAdapter.
How to use the generated loop (manual Send wiring). This tool creates only the RECEIVE side. After creating, e.g., "EchoLoop":
- Open the Audio Mixer window and select a source group (e.g. SFX or Voice).
- Add a Send effect to that source group.
- Set the Send's target to this loop group's Receive effect.
- Use the source Send's wet level to control how much is routed in, and this loop's trailing Attenuation to control the overall returned wet output.
The tool intentionally does NOT add or configure Sends on other groups, so it never mutates any group besides the new loop group and its parent relationship.
SoundMixerEffectLoopActionScriptGenerator
Editor-only generator that emits an Enable + Disable EventDispatcher action/signal pair for each
source group of an effect loop, so the loop can be toggled from a menu without hand-writing scripts.
It reuses the SAME generation as the manual "Action Script" tool
(Serenity.UnityGlobal.Infrastructure.Editor.SerenityEventDispatcherActionScriptCreator.CreateActionScript(System.String,System.String,System.String,System.String[],System.String[],System.Boolean)), injecting an Execute
body that resolves ISoundMixerService and calls ApplyEffectLoop / ClearEffectLoop
for that (loop id, source group). Idempotent: existing files are skipped. Never throws to the caller.
SoundMixerEffectLoopActionScriptGenerator.Result
Outcome of a generation run.
SoundMixerEffectLoopRegistrar
Editor-only helper that registers an effect-loop definition into the project's
UnitySoundMixerSettings so the runtime service can resolve it by id (the service builds
its lookup strictly from settings.EffectLoops). Idempotent: it adds the definition only when
missing. The target settings asset is matched by its AudioMixer reference, falling back to the single
settings asset in the project when no exact match is possible. Never throws to the caller.
SoundMixerEffectLoopRegistrar.RegistrationReport
Outcome of an EnsureRegistered(UnitySoundMixerEffectLoopDefinition) call.
SyncSoundMixerEffectLoopsWindow
Editor window (Tools > Serenity > Audio > Sync Effect Loops) that makes the AudioMixer match the
project's effect-loop definitions. The definition is the source of truth: add a source group to a
definition's Sources, press Sync, and the mixer wiring (Send + exposed parameters) appears —
idempotent and additive.
UnitySoundMixerEffectLoopDefinitionFactory
Editor-only service that creates and persists a UnitySoundMixerEffectLoopDefinition asset for a freshly created effect loop. Contains NO UI: it takes a CreateSoundMixerEffectLoopDefinitionInput and returns a CreateSoundMixerEffectLoopDefinitionOutput, mirroring the separation used by AudioMixerEffectLoopCreator for the mixer side.
Validates the request, blocks duplicate loop ids (scanning existing definition assets), writes the asset to a collision-free path, and never throws to the caller.