Well, the title says it all. The idea is to monitor ambient noise. As soon as a certain pattern is detected, the audio signal should be recorded to a file. The difficulty is that the recorded file should start a few seconds before the pattern is detected. Hence the audio signal is needed in memory to be able to "go back" a few seconds. Do you have any ideas how to get the raw audio input into memory in real time?