Thank you duff, but i'm looking for the possibility to apply FFT (or YIN) in realtime, acquiring the signal with a mic and returning the main frequency, just like a guitar tuner does.
These examples show an YIN application on a recorded sound, am I right?