> What happens if the buffers are swapped before the buffer-filling routine has finished?
Have you ever had a soundcard's driver crashing? Usually that leads to a loud harsh tone. That's when the buffer is repeatedly played by the soundcard. The driver doesn't refill it with new values anymore, so it's content is repeatedly played like a wavetable, which results in this weird, harsh tone.