3

I have a .wav file that is being continuously appended to. Is it possible to play this file using the HTML <audio> element? Here is my current approach:

<audio controls="controls" autoplay="autoplay" preload>
  <source src="stream.wav/" type="audio/wav">
</audio>

If I refresh the page, it reflects the new audio available in the file, but it does not render as a streaming player. It seems like it should be playing in "live" mode according to this question.

I would also be open to using some kind of framework or JavaScript to accomplish this if that would be best practice, but I haven't found anything yet.

Mark Lyons
  • 1,354
  • 6
  • 21
  • 57
  • What program is adding to the WAV file? That data might have to be put into something like gstreamer or ffpmeg to get started. – MikeHelland Mar 06 '19 at 02:08

2 Answers2

2

Files cant end in /

src="stream.wav/"

Should be src="stream.wav"

Phil
  • 311
  • 1
  • 6
  • That does not appear to make it reflect as a live stream. Is there anything else you would suggest trying? – Mark Lyons Mar 01 '19 at 20:59
  • I'm thinking that maybe the premise is flawed -- I'm expecting that simply updating my .wav file as I have new frames to add will accomplish this, and I'm guessing there's something else I need to do to make the HTML recognize it as a live stream. – Mark Lyons Mar 01 '19 at 21:03
-1

In order to stream live audio and video, you will need to run specific streaming software on your server or use third-party services.

https://developer.mozilla.org/en-US/docs/Web/Guide/Audio_and_video_delivery/Live_streaming_web_audio_and_video#Server-side_Streaming_Technologies

That section of that page lists a few popular options for doing this.

piet.t
  • 11,718
  • 21
  • 43
  • 52
MikeHelland
  • 1,151
  • 1
  • 7
  • 17