Increasing the performance of the audio system
In game development, the importance of audio is often overlooked. Sometimes this is also reflected in performance optimization. Game developers usually invest more effort in other performance areas, such as performance optimization for graphics rendering. But as games become more and more complex, audio can also cause performance problems, such as greater memory usage and so on. In this section, we will explore how to optimize audio performance in Unity.
The Unity Profiler
First, we should learn how to use the Unity Profiler tool to view and locate performance bottlenecks caused by the audio system in Unity:
- Click Window | Analysis | Profiler or use the keyboard shortcut Ctrl + 7 (command + 7 on macOS) to open the Profiler window.
- Click the Audio module area in the Profiler window to view the performance data of the audio system. You can find out how many Audio Sources are playing, the number of audio clips being used...