Spawning based on Music

Hey guys, i am am trying to build something with music in Unity. I am able to scale objects with the Music using the spectrum data(GetSpectrumData), but i want to spawn objects using the music.

I am not sure how to proceed with this. Any help will be appeciated. Thanks.

There are a number of ways to use the output of GetSpectrumData over time to determine when something significant has happened in the audio. You want to find some algorithm that says “this spectrum data is more significant than usual”. This article walks through one algorithm using spectral flux to find peaks in the spectrum.