Hi everyone, I'm using LiveKit Egress to record au...
# ask-ai
k
Hi everyone, I'm using LiveKit Egress to record audio from a session that includes both a user and an AI agent speaking. Separately, I’ve retrieved the conversation history (from session logs) containing all the user and agent messages with timestamps(created_at). What’s the best way to sync this session history with the audio recording? Are there any timestamps or metadata from Egress that I can use to align them accurately? Thanks in advance for any tips!
t
Thanks for reaching out, Jex. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
LiveKit Egress provides precise timing metadata in its output that you can use to synchronize your session history or conversation logs with the audio recording: • started_at and ended_at: The Egress response includes timestamps (in Unix milliseconds) for when the recording started and ended. • duration: The file metadata also contains the total duration of the recorded audio. You can use the
started_at
timestamp to align your session log events with the beginning of the recording, as both your logs and the Egress metadata are timestamped. By subtracting
started_at
from a log entry's timestamp, you get its offset within the recording—making accurate alignment possible. This approach allows you to correlate transcript events, user messages, or AI responses with their exact positions in the audio file. The timing metadata is available in the Egress API's
EgressInfo
and related structures. Sources: livekit-protocol/livekit/protocol/egress.pyi