From the course: OpenAI API: Building Front-End Voice Apps with the Realtime API and WebRTC

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

Understanding the WebRTC flow

Understanding the WebRTC flow

- [Instructor] Whether this is the first time you're working with WebRTC, or you have plenty of experience with it, let's quickly review what WebRTC is, how it works, and how to set it up. WebRTC or web real-time communication is a protocol to allow two computers to connect directly with each other to send information without a server as an intermediary. This allows for real-time communication, not only with text and data, but also with audio and video, and facilitates video chats and audio chats on the web. Traditionally, WebRTC is used to make chat between people, but there's no reason why we can't use WebRTC to make a chat between a person and a computer. And that's what we're doing with the OpenAI Realtime API. WebRTC comprises three main components, the MediaStream API that allows the browser to access the camera and or microphone on your device. An RTCPeerConnection objects that manages the connection of audio and video between the peers and an RTCDataChannel where you send…

Contents