Create audio spectrum

I am trying to figure out how to generate an audio spectrum in haxe and have no idea where to start. I have exhausted searches on the subject and can’t find any info on this, any pointers would would be greatly appreciated.

Maybe the Grig libraries? Do a search for “pitch” in their API.