fengb / fundude

Gameboy emulator: Zig -> wasm
https://fengb.github.io/fundude/
MIT License
181 stars 8 forks source link

Audio design #40

Open fengb opened 4 years ago

fengb commented 4 years ago

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:

  1. Circular queue. We need some mechanism to coordinate the exact offset or there could be floating point drift.
  2. 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.