   Sound Recording and Playback at the Same Time
  I am running Windows 7, 64-bit, programming in C++.I want to feed audio input from a microphone to the speakers in real time.  I tried using the Win32 WaveIn and WaveOut APIs, but the latency was much to large (as in, > 800 ms).What is the smallest delay I can expect to achieve, and what audio library would allow me to do so?I am looking into OpenAL (and considering FMOD as well?).  DirectSound also sounds promising, but it is technically deprecated and being phased out, it seems.Audacity seems to do a fairly decent job at software playthrough (you can enable it in the preferences).  I want to achieve at least that level of performance.   
  You can do that very easily without writing any code at all: http://blogs.msdn.com/larryosterman/archive/2009/08/04/a-few-of-my-favorite-win7-sound-features-capture-monitor-aka-listen-to.aspxHowever if you want to do it with code so you can say process the data the main thing to note is when doing that you want really small buffers (a few hundred samples at most). The bigger the buffer the more latency you get. For example at a standard 44.1 KHz sampling rate 441 samples take 10ms to play.You could also look into ASIO which is an API aimed specifically at low latency audio, but not all hardware supports it.There's also WASAPI.   ;  Small buffers - got it.  But I'm also trying to do an FFT on the data - and from my knowledge of FFTs, larger buffers give more accurate fourier transforms.  I'm trying to determine the fundamental pitch of the mic input in real time - I guess the problem is using a small buffer size with FFTs doesn't work very well.Hmmm...I wonder how autotune does it.   