javascript – html audio keeps getting interrupted

I have a web based kisok, running on a raspberry pi, which plays sound continuously and displays information. Problem is that the audio gets interrupted when other things are happening. You hear lots of short pauses. For example when sometimes when I receive a mqtt message using (using Paho mqtt library) there is a pause. Or if I’m running a slideshow, there are lots of pauses when it’s presumably loading the next image.

Is there any way to avoid this or can anyone explain why it happens?

I’ve noticed that if the audio player is isolated in a separate tab (chrome) it is unaffected by the other activities. But I would much prefer to keep everything on one page if possible.


Read more here: Source link