Introducing GetSpectrumDataHelper!
Check it out and the promo video here:
The GetSpectrumDataHelper (GSDH) script calls the Unity native Audiosource.GetSpectrumData() method and helps you make sense of the data returned so you can get audio frequency to drive visuals right away. GSDH always returns 128 values corresponding to the musical frequencies on a piano as well as an octave below and two above, and returns decibel values with control over their relative range. Furthermore the return data is calibrated with an equal loudness contour curve to help your audio visualizer match as closely as possible to how your ear hears frequencies and volume changes.
It also has a debug graph, dropdown selectors for fft window type, channel selection, audiosource vs audiolistener, and sample count so you can quickly setup your audio frequency analysis, confirm its output range and dial it for whatever visuals you want to drive.

It comes with 3 examples of a simple, visually interesting, and well commented, audio visualizer to help get you started.
GSDH returns its 128 values as decibel values (instead of signal power/voltage) which also helps the data relate better to the way we perceive volume. There is a slider for the reference value (decibels always need a reference value since they are a relative measurement) which helps bring the db values out of the (correctly) negative to 0 range of the digital audio world and into the 0 to positive range so it can be used to drive an audio visualizer’s given parameters. This is done by setting the reference value to a number very close to 0.
Finally the data is calibrated once more using an equal loudness contour curve to compensate for how the human ears sensitivity varies for different frequencies.
To get started using GSDH you can open up any one of the three example scenes, replace the audio in the audio source game object with audio of your choosing and hit play!
Or throw the script on an empty game object then call it like this from any other script:

Hope this asset helps lots of programmers, artists, and musicians leverage this functionality in Unity to create really cool audio visualizers! It’s time for the unity community to go wild with audio visualization!!!
