Example of how to capture and play the microphone input in Unity.
Latency is around 200ms, but this can very depending on your hardware and Unity settings. For a lower latency I would recommend using Lasp, or UnityWASAPILoopbackAudio(only for Windows).
It is also possible to do this not for a microphone, but also capture and playback the audio currently playing on the computer. To do this setup your audio settings / card as described here.
Useful for e.g. a music visualizer.