Open NyuBlara opened 2 weeks ago
I tried isolating setTimeout to its own worker in a branch, but it seems to have no effect. It also creates a hard-to-reproduce bug where sometimes playback becomes super-fast and impossible to stop. So this might not be the solution after all...but then, where do these delays come from ? They weren't there before visualizers were implemented.
Audio playback is slowed down by anything happening in the UI thread. This is very often the case with the SheetMusic visualizer's logic (#101), but can also happen for any number of reasons ; resources are fluctuating in nature.
Thus, perhaps it would be better to isolate audio playback in its own thread, so that its setTimeouts are never delayed by UI thread events.