billowy-hairdresser-80384
12/13/2025, 6:45 AMtall-airline-16756
12/13/2025, 6:45 AMtall-airline-16756
12/13/2025, 6:45 AMTimedString isn’t available — I can show alternatives (using speech_created + audio_duration or TTS metrics) once you confirm your setup.
Sources: Text and transcriptions | LiveKit docs | Observability data hooks | LiveKit docsbillowy-hairdresser-80384
12/13/2025, 6:47 AMtall-airline-16756
12/13/2025, 6:47 AMfrom livekit.agents import AgentSession
session = AgentSession(
use_tts_aligned_transcript=True,
# other config...
)
1. Read TimedText objects in your transcription_node to get timestamps:
from livekit.agents import TimedText
from typing import AsyncIterable
class MyAgent(Agent):
async def transcription_node(
self,
text: AsyncIterable[str | TimedText],
model_settings,
metadata,
) -> AsyncIterable[str | TimedText]:
async for chunk in text:
if isinstance(chunk, TimedText):
print(f"Transcript: '{chunk.text}' Start: {chunk.start_time:.3f}s End: {chunk.end_time:.3f}s")
else:
print(f"Transcript (no timing): {chunk}")
yield chunk
1. Important facts about available timestamps
• Agent TTS (LiveKit Inference): provides sentence-level timestamps via TimedText (start/end per sentence).
• Agent TTS (Cartesia or ElevenLabs): support word-level alignment (per-word start/end).
• User STT (LiveKit Inference): does not provide timestamps; user_input_transcribed gives only the transcript string.
1. Options if you need finer timestamps for user speech or word-level TTS:
• Use Cartesia or ElevenLabs for TTS to get word-level timing.
• Use an STT provider that returns alignment data for user speech, or estimate timings from speech_created + audio_duration.
Would you like a complete example script wiring session setup, transcription_node, and the user_input_transcribed handler?billowy-hairdresser-80384
12/13/2025, 6:48 AMtall-airline-16756
12/13/2025, 6:49 AMbillowy-hairdresser-80384
12/13/2025, 6:59 AMbillowy-hairdresser-80384
12/13/2025, 7:10 AM