Optimize Audio
Optimizes audio memory, CPU cost, and playback quality through import settings and...
Install
npx skills add Unity-Technologies/skills --skill optimize-audio -g -a claude-code -y- Repository
- Unity-Technologies/skills1.2k
- Category
- Media
- Updated
- 5d ago
- License
- See repository
- Context cost
- Mediumabout 3,000 tokens
- Runs scripts
- No, instructions only
What it does
Optimizes audio memory, CPU cost, and playback quality through import settings and mixer configuration. Use when asked to reduce audio memory or Audio Mixer CPU cost, change clip Load Types, sample rates or codecs, or force 3D audio to mono.
Critical Rules
- Do not make changes before reporting findings to the user
- Follow steps in strict order; never jump ahead
- STOP at every
WAITcheckpoint and await the user's response before continuing - Quality is more important than speed: measure before and after every change
- Always verify results in a device build; Editor audio stats are indicative only
0. Set up the execution path
Every C# step below runs inside a live Editor through the Unity CLI. The unity-cli skill owns
getting you there, installing the CLI, confirming a connected Editor, adding the project's
com.unity.pipeline package, telling a genuinely absent Editor apart from one stuck in Safe Mode,
and discovering the Editor's command catalog. Follow it first; don't re-derive any of it here.
Two things it can't know for you:
- You need
script evalin particular, not just a reachable Editor. Confirm it appears in the catalog. Its presence depends on the Pipeline package version, not on the CLI, so a healthy install can still lack it, if it's missing, say so and stop. - Do not hand-edit
.metafiles to change import settings. Importer values only take effect throughSaveAndReimport()in a live Editor, so an unreachable Editor is a stop, not a cue to edit metadata directly.
Run C# with unity command script eval --code '<snippet>'. Discover the parameter shape from
unity command --format json rather than assuming one. unity command defaults to a 30 second
timeout.
Passing C# to script eval
script eval compiles a statement block, not a file. Two consequences, both of which cause a compile
error rather than a warning:
- No
usingdirectives. The compiler readsusing UnityEngine;as a resource-disposal statement and rejects it (CS0210). - Types must be fully qualified. A bare
AssetDatabaseorAudioImporterdoes not resolve (CS0246/CS0103), and a bareObjectis ambiguous withobject(CS0104).


