WebRTC transport implementation using Daily for real-time audio/video communication
DailyTransport
provides real-time audio and video communication capabilities using Daily’s hosted WebRTC platform. It supports bidirectional audio/video streams, transcription, voice activity detection, participant management, and advanced features like dial-in/out and recording without requiring your own WebRTC infrastructure.
DailyTransport
, install the required dependencies:
DAILY_API_KEY
.
InputAudioRawFrame
- Audio data from room participantsUserImageRawFrame
- Video frames from participant camerasTranscriptionFrame
- Final speech transcriptionsInterimTranscriptionFrame
- Real-time transcription updatesTransportMessageUrgentFrame
- Application messages from participantsOutputAudioRawFrame
- Audio data to room participantsOutputImageRawFrame
- Video frames to participantsOutputDTMFFrame
- DTMF tones for phone callsTransportMessageFrame
- Application messages to participantsTransportMessageUrgentFrame
- Urgent messages to participantsDailyTransport
provides comprehensive methods for controlling calls and participants:
participants()
- Get current participants in the roomparticipant_counts()
- Get participant count statisticssend_message()
- Send messages to participantssend_image()
- Send image frames to the roomsend_audio()
- Send audio frames to the roomcapture_participant_video()
- Capture video from specific participantscapture_participant_audio()
- Capture audio from specific participantscapture_participant_transcription()
- Enable transcription for participantsstart_transcription()
- Start room-wide transcriptionstop_transcription()
- Stop transcriptionupdate_transcription()
- Update transcription settingsstart_recording()
- Start recording the callstop_recording()
- Stop active recordingsstart_dialout()
- Initiate dial-out callsstop_dialout()
- Stop dial-out callssend_dtmf()
- Send DTMF tonessip_call_transfer()
- Transfer SIP callssip_refer()
- Send SIP REFER requestsupdate_remote_participants()
- Control participant permissions and settingsupdate_subscriptions()
- Manage media subscriptionsupdate_publishing()
- Control media publishing settingssend_prebuilt_chat_message()
- Send messages to Daily Prebuilt chatDailyTransport
API
reference.DailyTransport
provides comprehensive event callbacks organized by category. Register callbacks using the @transport.event_handler()
decorator:
on_joined
- Bot successfully joined the roomon_left
- Bot left the roomon_call_state_updated
- Call state changeson_error
- Transport errors occuron_first_participant_joined
- First participant joins (useful for starting conversations)on_participant_joined
- Any participant joinson_participant_left
- Participant leaveson_participant_updated
- Participant information changeson_client_connected
- Client (participant) connectson_client_disconnected
- Client (participant) disconnectson_active_speaker_changed
- Active speaker changeson_app_message
- Application messages receivedon_transcription_message
- Speech transcription receivedon_dialin_*
- Dial-in connection events (ready, connected, stopped, error, warning)on_dialout_*
- Dial-out call events (answered, connected, stopped, error, warning)on_recording_started
- Recording beginson_recording_stopped
- Recording endson_recording_error
- Recording errorsDailyTransport
API
reference.