JoJoBond / 3LAS

Low Latency Live Audio Streaming
GNU General Public License v2.0
90 stars 23 forks source link

Can you move to Socket.IO ? #7

Closed VigibotDev closed 6 years ago

VigibotDev commented 7 years ago

Hello,

It's possible to use socket.IO instead of ws ? It can solve two new issues (I opened here) with the client and the server part of 3LAS...

I want to add your project inside mine, a Low latency web mobile robot, For all I use socket.io but not for audio where I use HTML5

https://www.serveurperso.com/?page=robot

JoJoBond commented 7 years ago

It certainly is possible to use socket.IO. Check socket_client.js to see how I implemented the client connection. Replacing it should be quite easy. Also have a look into stdinstreamer.js to see the server implementation.

VigibotDev commented 7 years ago

I just work to make a very simple low latency PCM player over socket.io (base64) with AudioContext and .onaudioprocess I can use your js MP3 codec if the one from AudioContext fail with my MP3 chunk

JoJoBond commented 7 years ago

You can't just feed mp3 frames into an AudioContext. Mp3 frames overlap, a single frame hold no useful information at all. You need to pass multiple frames and then stitch the samples together afterwards.

VigibotDev commented 7 years ago

Interesting. For now I must make a raw pcm streaming