Rercoding audio to a buffer


In a nutshell, I would like to record audio to a buffer and play it back. So far I managed to record to a file(based on the JUCEdemo example), but I am confused whether i have to use the AudioFormatWriter class or something else. A general overview on the structure of such an application would be a great start.

Thanks in advance!