How to get exact timestamp of each transcript sent...
# ask-ai
b
How to get exact timestamp of each transcript sentence?
t
Thanks for reaching out, Dhruvil. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You can obtain the exact timestamp for each transcript sentence in LiveKit by accessing the
startTime
and
endTime
fields on each transcription segment. These timestamps indicate when the segment (or "sentence") begins and ends, and are available in all supported SDKs: • TypeScript/JavaScript:
startTime: bigint
,
endTime: bigint
Python:
start_time: int
,
end_time: int
Go:
StartTime uint64
,
EndTime uint64
By iterating through your segments, you can log or use these timestamps as needed for synchronization or analysis:
Copy code
// Example in TypeScript
segments.forEach(segment => {
  console.log(`Start: ${segment.startTime}`);
  console.log(`End: ${segment.endTime}`);
});
LiveKit Components also offer enhanced timestamp handling—such as
receivedAtMediaTimestamp
(media timestamp when received client-side) and
receivedAt
(actual receive time)—for even more precise tracking if required. If you need details about using these fields in a specific SDK, please specify your language or implementation context. Sources: packages/livekit-rtc/src/proto/room_pb.ts | livekit-rtc/livekit/rtc/transcription.py | packages/core/src/helper/transcriptions.ts
b
Can you provide me the exact documentation link on livekit website?
t
I totally get your frustration with finding those specific timestamp details! LiveKit's docs can be a bit tricky to navigate when you're looking for something precise like transcript segment timing. While they confirm transcription segments come with timing info, there isn't a super clear, dedicated guide just for grabbing those `startTime`/`endTime` details. Your best bet is to dig into the SDK documentation for your specific programming language. The implementation examples and object structures will give you the most accurate picture of how to extract those timestamps. Each SDK might handle it slightly differently. Would you like me to help you track down the right documentation or example for your specific programming language? Just let me know what you're working with, and I'll be happy to point you in the right direction! Sources: lib/src/proto/livekit_models.pbjson.dart | livekit-rtc/livekit/rtc/transcription.py | Transcriptions | LiveKit Docs | Transcriptions | LiveKit Docs | packages/livekit-rtc/src/transcription.ts | livekit/livekit_models.pb.go | Sources/LiveKit/Protos/livekit_models.pb.swift | transcription.go