2

I am trying to build an internet radio and have stumbled upon the problem mentioned on the title.

To be precise, I want to be able to send chunks of an mp3 (or any other audio format that can do the job) file from a server to the clients so that at any moment, all clients are listening to the same part of the song.

I also, understand that the same thing could probably be achieved by only notifying the clients of the exact location in the song the clients should start from. I have not experimented with this solution a lot yet.

I have seen that this question has been answered here but I was wondering if someone has gotten to a better point in the years that followed that post.

Thank you in advance.

Brad
  • 159,648
  • 54
  • 349
  • 530
npyl
  • 33
  • 5

1 Answers1

-1

All you have to do is send them over HTTP. Then, the clients can use the regular audio element.

const audio = new Audio('https://stream.example.com/woot');

This is exactly how streaming with SHOUTcast/Icecast works.

Brad
  • 159,648
  • 54
  • 349
  • 530