Audio soundscape architect

From nlelouche/Unity-SkillForge · View interactive version

Audio soundscape architect is an AI agent skill from the GitHub repository nlelouche/Unity-SkillForge. Unity audio system specialist for immersive soundscapes, music, and audio management.

How to use this skill

Skill file

Audio & Soundscape Architect

Overview

Unity audio systems for immersive soundscapes. Covers AudioSource, AudioMixer, spatial audio, and integration with middleware (FMOD, Wwise).

When to Use

Architecture

┌─────────────────────────────────────────────────────────────┐
│                    AUDIO SYSTEM                             │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  AUDIO SOURCES         AUDIO MIXER         OUTPUT           │
│  ┌──────────┐         ┌──────────┐        ┌──────────┐     │
│  │ SFX      │────────▶│ SFX Group│───────▶│          │     │
│  │ Music    │────────▶│Music Grp │───────▶│  Master  │     │
│  │ Ambient  │────────▶│Ambient Gr│───────▶│          │     │
│  │ Voice    │────────▶│Voice Grp │───────▶│          │     │
│  └──────────┘         └──────────┘        └──────────┘     │
│                             │                               │
│                       [Effects]                             │
│                    Lowpass, Reverb                          │
│                    Ducking, Compress                        │
│                                                             │
└─────────────────────────────────────────────────────────────┘

Audio Categories

| Category | Use | Settings |

|----------|-----|----------|

| SFX | One-shot effects | 2D/3D, pooled |

| Music | Background tracks | Loop, crossfade |

| Ambient | Environment | 3D spatial, loop |

| Voice | Dialogue, narration | Priority, ducking |

| UI | Interface feedback | 2D, low latency |

AudioMixer Best Practices

| Feature | Purpose |

|---------|---------|

| Groups | Organize audio types |

| Snapshots | Preset mixer states |

| Ducking | Lower music during dialogue |

| Exposed Parameters | Runtime volume control |

| Send/Receive | Shared effects (reverb) |

Best Practices

Few-Shot Examples

Example 1: Audio Manager Setup

User: "Create a simple audio manager."

Agent:

public class AudioManager : MonoBehaviour
{
    [SerializeField] private AudioMixerGroup _sfxGroup;
    [SerializeField] private AudioMixerGroup _musicGroup;
    
    public void PlaySFX(AudioClip clip, Vector3 position)
    {
        var source = GetPooledSource();
        source.clip = clip;
        source.outputAudioMixerGroup = _sfxGroup;
        source.transform.position = position;
        source.Play();
    }
}

Example 2: Music Crossfade

User: "Fade between music tracks."

Agent:

public async UniTask CrossfadeMusic(AudioClip newTrack, float duration)
{
    var fadeOut = _currentSource.DOFade(0, duration).ToUniTask();
    _nextSource.clip = newTrack;
    _nextSource.volume = 0;
    _nextSource.Play();
    var fadeIn = _nextSource.DOFade(1, duration).ToUniTask();
    await UniTask.WhenAll(fadeOut, fadeIn);
    (_currentSource, _nextSource) = (_nextSource, _currentSource);
}

Example 3: Ducking Setup

User: "Lower music during dialogue."

Agent:

AudioMixer setup:
1. Create "Ducking" snapshot
2. Lower Music group by -10dB
3. Expose "MusicVolume" parameter

Code:
_mixer.TransitionToSnapshots(
    new[] { duckingSnapshot }, 
    new[] { 1f }, 
    0.3f);

Middleware Comparison

| Feature | Unity Audio | FMOD | Wwise |

|---------|:-----------:|:----:|:-----:|

| Cost | Free | Indie free | $$ |

| Ease | Easy | Medium | Advanced |

| Features | Basic | Rich | Enterprise |

| 3D Audio | Good | Excellent | Excellent |


TDD Contract

⚠️ Legacy Skill — Refactor Pending

Este skill NO tiene tests automatizados aún. El siguiente boilerplate es un punto de partida.

// Escribe estos tests ANTES de implementar:

// Test 1: should [expected behavior] when [condition]
[Test]
public void AudioSoundscapeArchitect_Should{ExpectedBehavior}_When{Condition}()
{{
    // Arrange
    // TODO: Setup test fixtures
    
    // Act
    // TODO: Execute system under test
    
    // Assert
    Assert.Fail("Not implemented — write test first");
}}

// Test 2: should handle [edge case]
[Test]
public void AudioSoundscapeArchitect_ShouldHandle{EdgeCase}()
{{
    // Arrange
    // TODO: Setup edge case scenario
    
    // Act
    // TODO: Execute
    
    // Assert
    Assert.Fail("Not implemented");
}}

// Test 3: should throw when [invalid input]
[Test]
public void AudioSoundscapeArchitect_ShouldThrow_When{InvalidInput}()
{{
    // Arrange
    var invalidInput = default;
    
    // Act & Assert
    Assert.Throws<Exception>(() => {{ /* execute */ }});
}}

Pasos para completar el TDD:

  1. Descomenta los tests above
  2. Implementa la funcionalidad mínima para que compile
  3. Ejecuta los tests — deben fallar (RED)
  4. Implementa la funcionalidad real
  5. Verifica que los tests pasen (GREEN)
  6. Refactorea manteniendo los tests verdes

Nota: Este skill fue marcado como tdd_first: false durante la auditoría v2.0.1. La sección TDD fue agregada automáticamente pero requiere customización manual para reflejar el comportamiento real del skill.

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.