sound lagging when changing tab
When I play a song and change tab, the sound is lagging. Any idea on how to fix this ?
Looks like when this happens, I get these messages in the console:
buffer under run!!
Looks like that increasing CircularAudioBuffer size does the trick for a little while, then it lags again.
I guess that increasing the circularbuffer size only makes wildmidi fill it when the tab has the focus. The problems seems to come from wildmidi processAudio which is not called fast enough, maybe using webworkers could help ?
This is a limitation of web browser - they throttle cpu usage when a tab is backgrounded
The workarounds are 1) move it to a new window instead of a new tab, 2) pause the music if the tab is backgrounded