O'Reilly logo

Socket.IO Cookbook by Tyson Cadenhead

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Streaming audio

Streaming images with Socket.IO is great. However, we can use WebSockets in combination with WebRTC to stream audio from one user's microphone to another.

WebRTC (Web Real-Time Communication) is an API that supports browser-to-browser real-time media sharing for applications such as voice calling, video chat, and peer-to-peer file sharing. WebRTC is still a relatively new technology. While WebRTC has support in most browsers, at the time of writing this book, Internet Explorer and Safari do not yet support it.

For two browsers to directly communicate over WebRTC, there is a handshake process that needs to take place. This means that one client makes an offer containing a description of the offer. The second client must then accept ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required