Samples are acquired from an analog-to-digital converter at interrupt level and written to one of two ping-pong buffers. When one buffer fills, the interrupt handler switches to the other and sets a flag for the full buffer to be written to disk.
Source: tatoeba (2099835)