In this lesson, you will learn how to leverage Unreal Engine’s diagnostic tools to pinpoint performance bottlenecks within your MetaSound graphs and manage voice counts effectively.
As your MetaSound graphs grow in complexity—especially when utilizing granular synthesis or additive synthesis chains—they can place a heavy load on the audio render thread. When your soundscape begins to crackle or stutter, it is time to move from "designing" to "profiling."
Utilizing Audio Diagnostics
The primary tool for this is the stat audio command. By typing this into your console during a Play-In-Editor (PIE) session, you reveal a real-time dashboard. Look closely at the "Audio Render Thread" time. If this value consistently spikes, your MetaSound graphs likely have too many active math nodes or nested modulation chains processing every frame.
Identifying Voice Bottlenecks
High CPU usage is often caused by having too many concurrent instances of a high-fidelity MetaSound. To investigate this, use the au.MetaSound.VisualizeGraph console command or the Audio Mixer Debugger. These tools allow you to see exactly how many voices are currently active.
If you notice a high number of active voices, you are likely hitting the limits of your Audio Concurrency settings. You can resolve this by:
- Limiting Polyphony: Set a strict Max Count on your
Sound Concurrencyasset to force the engine to kill older voices when new ones start. - Graph Pruning: Use the
Enableinput on heavy MetaSound nodes. If a spectral filter isn't strictly necessary for a background sound, use aSwitchnode to bypass the heavy processing path.
Example: Monitoring Voice Counts
To identify if a specific sound is a "voice hog," you can use the ListWaves console command. This identifies which assets are loaded in memory and their current status. If you see hundreds of active voices, consider implementing a "virtualization" approach where sounds further than a certain distance from the listener are stopped or swapped for simpler, non-synthetic stereo assets.
Key Takeaway: Use stat audio to monitor your render thread budget and rely on Concurrency settings to cap the number of active MetaSound voices, ensuring your procedural synthesis doesn't starve the CPU.