Audio volume change?

How can I measure a sudden increase in the volume of an audio source(to create a music visualizer like effect) using AudioSource.GetOutputData or AudioSource.GetSpectrumData ?

Looks like this is what you want to do to analyze the data.