steep-keyboard-85291
10/28/2025, 8:14 AMtall-airline-16756
10/28/2025, 8:14 AMtall-airline-16756
10/28/2025, 8:14 AMuse_tts_aligned_transcript=True in your AgentSession. This will make sure the agent’s generated speech and the transcript timestamps are perfectly in sync.
2. Override the transcription_node method in your agent class to receive TimedString objects, which come with start_time and end_time fields.
3. Make sure your AgentSession uses a supported TTS provider, like Cartesia or ElevenLabs, especially if you want word-level timestamps.
Here’s an example to guide you:
async def transcription_node(self, text: AsyncIterable[str | TimedString], model_settings: ModelSettings) -> AsyncGenerator[str | TimedString, None]:
async for chunk in text:
if isinstance(chunk, TimedString):
print(f"Text: '{chunk}', Start: {chunk.start_time}, End: {chunk.end_time}")
yield chunk
session = AgentSession(
stt=deepgram.STT(),
llm=openai.LLM(),
tts=cartesia.TTS(),
vad=silero.VAD(),
use_tts_aligned_transcript=True,
)
This setup will give you accurate word-by-word or sentence-by-sentence transcripts with precise timing. If you have any questions or need a hand with anything else, please don’t hesitate to ask—I’m here to help!
Sources: Text and transcriptions | LiveKit Docs | livekit-agents/livekit/agents/metrics/base.py | livekit/livekit_models.pb.go | livekit-protocol/livekit/protocol/models.py | Understanding Transcript Timing in Voice Conversationssteep-keyboard-85291
10/28/2025, 8:16 AMtall-airline-16756
10/28/2025, 8:16 AMuse_tts_aligned_transcript=True in your AgentSession. This helps ensure your transcription is perfectly synced with speech timing.
2. Next, override the transcription_node method in your agent class to handle TimedString objects. These objects come with start_time and end_time fields, showing the timing in seconds relative to the start of the turn.
Here’s a quick example to guide you:
async def transcription_node(self, text: AsyncIterable[str | TimedString], model_settings: ModelSettings) -> AsyncGenerator[str | TimedString, None]:
async for chunk in text:
if isinstance(chunk, TimedString):
print(f"Text: '{chunk}', Start: {chunk.start_time}, End: {chunk.end_time}")
yield chunk
session = AgentSession(
stt=deepgram.STT(),
llm=openai.LLM(),
tts=cartesia.TTS(),
vad=silero.VAD(),
use_tts_aligned_transcript=True,
)
This setup will help you get sentence-level timing when using supported TTS providers. If you have any questions or need a hand with anything else, please don’t hesitate to reach out—I’m here to help!
Sources: livekit-plugins/livekit-plugins-baseten/livekit/plugins/baseten/stt.py | Pipeline nodes and hooks | LiveKit Docs | Text and transcriptions | LiveKit Docs