Visualization performance and windowing

As we have seen, we are calling GetSpectrumData in the Update method, not once but twice. Now that you understand some of what is happening under the covers, you can likely appreciate that those calls are quite expensive, which they are. Of course, there are some things we can do to make those calls run quicker, but as always there are trade-offs and your visualizations could suffer. Although, if your game scene is running at a poor frame-rate that really is not much better.

If you wanted to run an audio visualization through a game you built for a mobile platform, such as phone, you would likely want to turn the number of samples down to 64.

Let's look at some settings we can tweak to improve the performance ...

Get Game Audio Development with Unity 5.X now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.