We need to have some form of continuous sampling. Due to how humans perceive sound, any break in this sampling will result in noticeable stuttering and popping.
Thoughts:
Circular queue. We need some mechanism to coordinate the exact offset or there could be floating point drift.
Buffer a few frames behind. Humans can tolerate ~150ms of lag without perception, and having this lag period allows for the core to 'catch up' against any waggle caused by core and browser not perfectly synchronized.
We need to have some form of continuous sampling. Due to how humans perceive sound, any break in this sampling will result in noticeable stuttering and popping.
Thoughts: