web synth docs

latency-hint

Web synth runs on [web-audio] which handles setting up an audio context that works for the current system's operating system, audio system, and hardware. When creating this context, there is an option to set a manual latencyHint which can be set to target a specific latency for the context.

Higher latencies means there is more time between things like MIDI keypreses and sound getting produced, but this can be necessary in certain situations. Lower latencies typically require more processing power in order to work smoothly without buffer underruns and other audio artifacts, and certain sound systems on operating systems like Linux can have issues with low latencies as well.

By default, web synth doesn't provide a latencyHint to the audio context and relies on web audio and the browser to set one. The exception is for Linux, where a higher latency hint is manually picked to work around those issues mentioned before.

The latency hint can be configured in web synth via the [global-menu]. If you encounter issues with clicks/pops during playback or other issues, you can try setting it to a manual value and setting it to something like 0.025 or higher and see if that helps. Also, if you're on Linux, you can try setting it back to the default value to potentially reduce your playback latency if your system doesn't suffer from the issues that the workaround targets.

Referred in

latency-hint