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