brief-dress-9950
02/27/2026, 2:28 PMtall-airline-16756
02/27/2026, 2:29 PMStartTrackEgress({
RoomName: "your-room",
TrackId: "participant-audio-track-id",
Output: {
File: {
FileType: "OGG",
Filepath: "recordings/agent-audio.ogg",
Output: {
S3: {
AccessKey: "AWS_ACCESS_KEY",
Secret: "AWS_SECRET",
Bucket: "your-bucket",
Region: "us-west-2"
}
}
}
}
})
• You obtain TrackId from the room/participant list or from Webhook events (participant joined/published).
1. Automate with webhooks
• Use LiveKit webhooks to trigger egress: e.g., start egress when a room starts or when a participant begins speaking, and stop on egress_ended or room_ended.
• Listen for egress_started and egress_ended events to track status and errors.
1. Alternative: WebSocket forwarding for real-time processing
• If you need real‑time processing (transcription, VAD, custom transforms) before storing, configure egress to stream raw PCM audio to a WebSocket endpoint.
• Your WebSocket server can process audio frames and then upload results or the original file to S3.
1. Secure credentials
• For production, prefer IAM roles (AssumeRole) instead of storing long‑lived AWS keys in config. Egress supports assuming a role (configure the assume role fields) so LiveKit can write to S3 securely.
1. Post-processing and correlation
• Use egress metadata (timestamps, participant IDs) and webhooks to correlate stored audio with sessions/agents.
• Optionally combine audio files with transcripts or tracing metadata in your own pipeline.
If you want, tell me:
• which Server SDK you use (Go / Node / Python), and
• whether you want per-track recordings or full-room recordings, and
• whether you prefer to use AWS access keys or AssumeRole for S3 access,
and I’ll provide a concrete code snippet and a webhook flow you can drop into your self‑hosted deployment.
Sources: Universal Egress | Universal Egress | server-sdk-js | livekit/livekit_composite | DeepWiki | Universal Egress