-2

I'm trying to plan a learning curve for a nodeJS module that streams all my output sounds to a server. Say I have a nodeJS module that forwards all outgoing sounds and music as packets to the server's port 8000. How can I connect some client's mp3 player to playback the streaming audio formats from the server?

I mean the buffer that is sent is just raw messy bits, how to make my audio player on the client recognize the format, connect to the stream, forward the packets to the player etc.

Ivan Kaloyanov
  • 1,748
  • 6
  • 18
  • 24

2 Answers2

0

You (I) need to open up a file, meaning by that a resource through POST request's answer and transmit to that file chunks of data from your original video resource according to the indices[ranges] the request asks for. So the request asks for data at xyz (just in an additional field) and tries to download resource Z and you constantly fill that resource with data so that it is always full.

0

This is a rather complex topic but there are many examples and documentation already available.

Just doing a quick search these came out:

node (socket) live audio stream / broadcast

https://www.npmjs.com/package/audio-stream

By the way, I'm not an expert but I think if you want to do audio streaming probably mp3 is not the right choice and you may get some benefit if you convert it to an intermediate streaming format.

Matteo Ugolotti
  • 367
  • 3
  • 12