Get live streaming audio from NodeJS server to clients

前端 未结 2 1395
臣服心动
臣服心动 2021-01-31 20:44

I need to have a real time live audio stream from 1 client to a server to multiple listener clients.

Currently I have the recording from the client working and stream t

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-31 21:29

    I'm a bit late to the party here but it looks like the web audio API will be your friend here, if you haven't already finished it. It allows you to play an audio stream directly to the output device without messing around with attaching it to an audio element.

    I'm looking at doing the same thing and your question has answered my question - how to get data from client to server. The benefit of the web audio API is the ability to add streams together and apply audio effects to it on the server.

    MDN Web Audio API

    The io events should replace the data in an audio buffer object in the audio context. Audio processing can happen in the nodeJS web audio context before being emitted as a single stream to each client.

提交回复
热议问题