Reputation: 809
There are solutions for HTML5 to get audio stream by using <audio>
or <video>
tag. Can I have the step reverse? What if I stream to the server by using getUserMedia()
and websocket?
It seems that it is not simple as I cannot get the byte stream directly. Is it possible indeed? If possible, how to put the audio stream to server by websocket ws.send()
?
Thanks.
Upvotes: 1
Views: 1865
Reputation: 2275
Websockets is not a protocol for streaming. However you can achieve your task by using webrtc. It will be much easier doing webrtc p2p than client to server but it can be done. You can actually stream both audio and video to a server from html5 (webrtc).
Look at the webrtc specifications and then implement the ICE, TURN on your server to get the negotiation running. You will then be able to recieve the streams from several browsers to your server.
Not easy... But it can be done :)
Upvotes: 3