0

I have a process which records MP3 clips from a live audio stream. When the stream goes silent, the recording stops, and when it goes live again, a new MP3 begins recording.

I want a client to be able to listen to any MP3, even if it still being recorded. Streaming a complete MP3 file is pretty straightforward. I'm struggling, however, to find out how I could begin streaming a partial MP3 from my server, even while it's still being appended to, and be sure that my user will hear the entire clip (not just the part that existed when the MP3 began streaming). In other words my streaming server needs to be smart enough to know that the MP3 it's streaming is growing.

I've looked into IceCast and Ffserver but haven't been able to find any answers to this question.

  • For on-demand content Icecast (no camel case!) is the wrong tool. It will depend both on the webserver AND the client if a file that's being written to will be sent/received beyond the initial file size. So consider that unreliable, no matter what. – TBR Dec 13 '15 at 20:04

1 Answers1

0

What you're looking for is HLS.

Basically, your stream is split up into chunks, each of its own file, and tied together with a playlist. This will enable your listeners to go back at any point (assuming you keep those chunk files around), as well as listen to the most recent chunk (within a couple seconds of "live").

See also: https://stackoverflow.com/a/10047372/362536

Community
  • 1
  • 1
Brad
  • 159,648
  • 54
  • 349
  • 530