Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

64
Visualizações
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.

Thanks!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I could imagine what is happening is the sound may be 2s long and if you get multiple "pings" this must completely play through still. The bypass is to pause the sound, set currentTime to 0 and re-play each message.

The result is that if you have ten messages coming in real quick, you'll hear 10 alerts but perhaps 0.1s 0.1s 0.1s ... 2s

mysound.pause();
mysound.currentTime = 0;
mysound.play();
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda