Skip to content
audio-systems logo

Audio & Sound Systems

audio-systems

Game audio systems, music, spatial audio, sound effects, and voice implementation. Build immersive audio experiences with professional middleware integration.

SKILL.md

Full skill instructions

Audio & Sound Systems

Audio Architecture

┌─────────────────────────────────────────────────────────────┐
│                    GAME AUDIO PIPELINE                       │
├─────────────────────────────────────────────────────────────┤
│  SOURCES: SFX | Music | Voice | Ambient                     │
│                         ↓                                    │
│  MIDDLEWARE: Wwise / FMOD / Engine Audio                    │
│                         ↓                                    │
│  PROCESSING: 3D Spatial | Reverb | EQ | Compression         │
│                         ↓                                    │
│  MIXING: Master → Submixes → Individual Tracks              │
│                         ↓                                    │
│  OUTPUT: Speakers / Headphones (Stereo/​Surround/​Binaural)  │
└─────────────────────────────────────────────────────────────┘

Audio Programming

Unity Audio Manager

// ✅ Production-Ready: Audio Manager
public class AudioManager : MonoBehaviour
{
    public static AudioManager Instance { get; private set; }

    [System.Serializable]
    public class SoundBank
    {
        public string id;
        public AudioClip[] clips;
        [Range(0f, 1f)] public float volume = 1f;
        [Range(0.1f, 3f)] public float pitchVariation = 0.1f;
    }

    [SerializeField] private SoundBank[] _soundBanks;
    [SerializeField] private int _poolSize = 20;

    private Dictionary<string, SoundBank> _bankLookup;
    private Queue<AudioSource> _sourcePool;

    private void Awake()
    {
        if (Instance != null) { Destroy(gameObject); return; }
        Instance = this;
        DontDestroyOnLoad(gameObject);

        InitializePool();
        BuildLookup();
    }

    public void PlaySound(string id, Vector3 position)
    {
        if (!_bankLookup.TryGetValue(id, out var bank)) return;
        if (bank.clips.Length == 0) return;

        var source = GetPooledSource();
        source.transform.position = position;
        source.clip = bank.clips[Random.Range(0, bank.clips.Length)];
        source.volume = bank.volume;
        source.pitch = 1f + Random.Range(-bank.pitchVariation, bank.pitchVariation);
        source.Play();

        StartCoroutine(ReturnToPool(source, source.clip.length));
    }

    private AudioSource GetPooledSource()
    {
        if (_sourcePool.Count > 0) return _sourcePool.Dequeue();
        return CreateNewSource();
    }

    private void InitializePool() { /​* ... */ }
    private void BuildLookup() { /​* ... */ }
    private AudioSource CreateNewSource() { /​* ... */ }
    private IEnumerator ReturnToPool(AudioSource s, float delay) { /​* ... */ }
}

FMOD Integration

// ✅ Production-Ready: FMOD Event Player
public class FMODEventPlayer : MonoBehaviour
{
    [SerializeField] private FMODUnity.EventReference _eventRef;

    private FMOD.Studio.EventInstance _instance;
    private bool _isPlaying;

    public void Play()
    {
        if (_isPlaying) Stop();

        _instance = FMODUnity.RuntimeManager.CreateInstance(_eventRef);
        _instance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(transform));
        _instance.start();
        _isPlaying = true;
    }

    public void SetParameter(string name, float value)
    {
        if (_isPlaying)
            _instance.setParameterByName(name, value);
    }

    public void Stop(bool allowFadeout = true)
    {
        if (!_isPlaying) return;

        _instance.stop(allowFadeout
            ? FMOD.Studio.STOP_MODE.ALLOWFADEOUT
            : FMOD.Studio.STOP_MODE.IMMEDIATE);
        _instance.release();
        _isPlaying = false;
    }

    private void OnDestroy() => Stop(false);
}

Spatial Audio

3D AUDIO CONFIGURATION:
┌─────────────────────────────────────────────────────────────┐
│  ATTENUATION CURVES:                                         │
│                                                              │
│  Volume │████████████                                       │
│         │            ████                                   │
│         │                ████                               │
│         │                    ████                           │
│         └──────────────────────────→ Distance               │
│         0m     10m    30m    50m                            │
│                                                              │
│  Min Distance: 1m (full volume)                             │
│  Max Distance: 50m (inaudible)                              │
│  Rolloff: Logarithmic (realistic)                           │
└─────────────────────────────────────────────────────────────┘

Music Systems

Adaptive Music State Machine

MUSIC STATE TRANSITIONS:
┌─────────────────────────────────────────────────────────────┐
│                                                              │
│   [EXPLORATION] ←──────────→ [TENSION]                      │
│        │                        │                           │
│        ↓                        ↓                           │
│   [DISCOVERY]              [COMBAT]                         │
│                                 │                           │
│                                 ↓                           │
│                            [VICTORY] / [DEFEAT]             │
│                                                              │
│  Transition Rules:                                           │
│  • Crossfade on beat boundaries                             │
│  • 2-4 bar transition windows                               │
│  • Intensity parameter controls layers                      │
└─────────────────────────────────────────────────────────────┘

Mixing Guidelines

BusContentTarget Level
MasterFinal mix-3dB peak
MusicBGM, Stingers-12dB to -6dB
SFXGameplay sounds-6dB to 0dB
VoiceDialogue, VO-6dB to -3dB
AmbientEnvironment-18dB to -12dB

🔧 Troubleshooting

┌─────────────────────────────────────────────────────────────┐
│ PROBLEM: Audio popping/​clicking                             │
├─────────────────────────────────────────────────────────────┤
│ SOLUTIONS:                                                   │
│ → Add fade in/​out (5-10ms)                                  │
│ → Check sample rate mismatches                              │
│ → Increase audio buffer size                                │
│ → Use audio source pooling                                  │
└─────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────┐
│ PROBLEM: Too many simultaneous sounds                       │
├─────────────────────────────────────────────────────────────┤
│ SOLUTIONS:                                                   │
│ → Implement voice limiting per category                     │
│ → Priority system (important sounds steal)                  │
│ → Distance-based culling                                    │
│ → Virtual voices (middleware feature)                       │
└─────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────┐
│ PROBLEM: Music transitions are jarring                      │
├─────────────────────────────────────────────────────────────┤
│ SOLUTIONS:                                                   │
│ → Align transitions to musical bars                         │
│ → Use crossfades (1-4 seconds)                              │
│ → Prepare transition stingers                               │
│ → Match keys between sections                               │
└─────────────────────────────────────────────────────────────┘

Optimization

PlatformMax VoicesCompressionStreaming
Mobile16-32High (Vorbis)Required
Console64-128MediumLarge files
PC128-256LowOptional

Use this skill: When implementing audio, designing sound, or composing music.

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View