A wrapper for Unity's Microphone class with a visualizer
Unity offers a Microphone class but not a higher level of abstraction that owuld make its implementation a lot simpler. There are assets in the Unity asset store which do this and more but here is a free solution.
Just open the Unity project in Unity5+ and try the demo scene. The code is self explainatory.
Ready to use spectrum methods such as for standard octaves