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

233
Visualizações
Flask broswer not playing updated audio file

Currently i have a script streaming sound and save abnormal sound to wav format, stored it to flask folder under templates.

Flask web server is streaming some sort of video. It can also play abnormal sound in the static folder.

After i start my web server and when the play button is being pressed, the abnormal sound is being played. However when there is another abnormal sound is detected, the sound clip will be updated in the static folder but the same old sound clip will still be played on the html page.

I have tried to load the saved sound clip in the JS function like this in the index.html:

<audio src="{{url_for('static', filename='/screams/new_scream.wav')}}" type="audio/mpeg" id="audiotag1" preload="metadata"/>
</audio>
<script type="text/javascript">
var song = document.getElementById('audiotag1')
function play_single_sound() {
song.load();
song.play();
}
</script>

I have also tried to remove the cache in flask as following:

app.config["CACHE_TYPE"] = "null"

both methods can't solve the problem.

Any other suggestion so i play the latest audio clip on the html page?

about 4 years ago · Juan Pablo Isaza
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