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

237
Visualizações
Load audio bytes as a source to <audio>

After reading a thousand website I still am not able to find the straightforward way to load a WAV file into an audio tag in HTML.

I have the following in my html:

<h2>Answer</h2>
<audio controls autoplay id="audioholder">
  <source id="audiosrcholder" src=none type="audio/wav">
  Your browser does not support the audio element.
</audio>

and the following in my script's success function of an AJAX request:

success: function(stream) {
            audiosrcholder.src = stream
            {#audiosrcholder.setData(stream)#}
            
            audioholder.load()
        }

where I note that the response of the used request contains a WAV audio file with a Content-Type header set to 'audio/wav'.

The idea is to not save the file locally, but directly stream it to the audio control.

If I log the WAV file (stream), I can see the actual WAV content starting with RIFF... Here is a snippet: RIFF����WAVEfmt

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