How to give live stream audio data in to html5 audio tag.
I am receiving continuous chunks of audio data [ wav formatted ] through web sockets from the nodejs server. How to make this data feed into audio tag in case of live streaming.
In my simple html file i have audio tag like below:
<audio id="audiowav" type="audio/wav" controls autoplay></audio>
Below is the set of codes used in my javascript file:
var socket = new WebSocket('ws://localhost:port');
socket.onmessage = function (event) {
// Data is coming at regular intervals
var stream = event.data; //type is audio/wav ( byte codes from nodejs server )
// how to feed this data to audio tag
}
Please provide some hints to proceed.