audio-systems
Game audio systems, music, spatial audio, sound effects, and voice implementation. Build immersive audio experiences with professional middleware integration.
What this skill does
# 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
```csharp
// ✅ 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
```csharp
// ✅ 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
| Bus | Content | Target Level |
|-----|---------|--------------|
| Master | Final mix | -3dB peak |
| Music | BGM, Stingers | -12dB to -6dB |
| SFX | Gameplay sounds | -6dB to 0dB |
| Voice | Dialogue, VO | -6dB to -3dB |
| Ambient | Environment | -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
| Platform | Max Voices | Compression | Streaming |
|----------|------------|-------------|-----------|
| Mobile | 16-32 | High (Vorbis) | Required |
| Console | 64-128 | Medium | Large files |
| PC | 128-256 | Low |Related in Image & Video
watch
IncludedWatch a video (URL or local path). Downloads with yt-dlp, extracts auto-scaled frames with ffmpeg, pulls the transcript from captions (or Whisper API fallback), and hands the result to Claude so it can answer questions about what's in the video.
physical-ai-defect-image-generation
IncludedUse when the user wants to orchestrate defect image generation, run associated setup, or handle outputs on OSMO. The Day 0 path handles cold-start with USD-to-ROI, image-edit augmentation, and AnomalyGen to create initial PCBA datasets. The Day 1 path performs inference and labeling on real images. This skill helps with first-time asset setup, creation of finetuning checkpoints, and configuring deployment. Trigger keywords: defect image generation, dig workflow, dig pipeline, defect image detection workflow, aoi pipeline, aoi anomalygen, usd2roi anomalygen, day 0 pcba, day 1 pcba, day 1 real-photo alignment, day 1 manual roi, metal surface anomaly, glass defect, anomalygen finetune, setup_pcb, setup_metal, setup_glass, setup_pretrained, dig setup, dig datasets, dig pretrained checkpoint, dig image-edit endpoint.
accelint-react-best-practices
IncludedReact performance optimization and best practices. ALWAYS use this skill when working with any React code - writing components, hooks, JSX; refactoring; optimizing re-renders, memoization, state management; reviewing for performance; fixing hydration mismatches; debugging infinite re-renders, stale closures, input focus loss, animations restarting; preventing remounting; implementing transitions, lazy initialization, effect dependencies. Even simple React tasks benefit from these patterns. Covers React 19+ (useEffectEvent, Activity, ref props). Triggers - useEffect, useState, useMemo, useCallback, memo, inline components, nested components, components inside components, re-render, performance, hydration, SSR, Next.js, useDeferredValue, combined hooks.
elevenlabs-agents
IncludedBuild conversational AI voice agents with ElevenLabs Platform using React, JavaScript, React Native, or Swift SDKs. Configure agents, tools (client/server/MCP), RAG knowledge bases, multi-voice, and Scribe real-time STT. Use when: building voice chat interfaces, implementing AI phone agents with Twilio, configuring agent workflows or tools, adding RAG knowledge bases, testing with CLI "agents as code", or troubleshooting deprecated @11labs packages, Android audio cutoff, CSP violations, dynamic variables, or WebRTC config. Keywords: ElevenLabs Agents, ElevenLabs voice agents, AI voice agents, conversational AI, @elevenlabs/react, @elevenlabs/client, @elevenlabs/react-native, @elevenlabs/elevenlabs-js, @elevenlabs/agents-cli, elevenlabs SDK, voice AI, TTS, text-to-speech, ASR, speech recognition, turn-taking model, WebRTC voice, WebSocket voice, ElevenLabs conversation, agent system prompt, agent tools, agent knowledge base, RAG voice agents, multi-voice agents, pronunciation dictionary, voice speed control, elevenlabs scribe, @11labs deprecated, Android audio cutoff, CSP violation elevenlabs, dynamic variables elevenlabs, case-sensitive tool names, webhook authentication
humanizer
IncludedHumanize AI-generated text by detecting and removing patterns typical of LLM output. Rewrites text to sound natural, specific, and human. Uses 28 pattern detectors, 560+ AI vocabulary terms across 3 tiers, and statistical analysis (burstiness, type-token ratio, readability) for comprehensive detection. Use when asked to humanize text, de-AI writing, make content sound more natural/human, review writing for AI patterns, score text for AI detection, or improve AI-generated drafts. Covers content, language, style, communication, and filler categories.
generating-mermaid-diagrams
IncludedSalesforce architecture diagrams using Mermaid with ASCII fallback. Use this skill when generating text-based diagrams for Salesforce architecture, OAuth flows, ERDs, integration sequences, or Agentforce structure. TRIGGER when: user says "diagram", "visualize", "ERD", or asks for sequence diagrams, flowcharts, class diagrams, or architecture visualizations in Mermaid. DO NOT TRIGGER when: user wants PNG/SVG image output (use generating-visual-diagrams), or asks about non-Salesforce systems.