nice-room-70150
09/30/2025, 4:26 AMtall-airline-16756
09/30/2025, 4:26 AMtall-airline-16756
09/30/2025, 4:27 AMRoomEvent.TranscriptionReceived event to get transcription segments in real time. Just a heads-up, this method is deprecated and will soon be replaced by text streams on the lk.transcription topic. Another great option is to use registerTextStreamHandler to listen to text streams and handle interim or final transcriptions smoothly.
• Agent-Side (Python): You might want to implement the RecognitionHooks protocol to catch transcription events. The on_interim_transcript method is perfect for interim results, while on_final_transcript works well for final results.
• React Applications: For real-time transcription, the useTranscriptions hook is a handy tool to access live transcriptions effortlessly.
If you'd like, I’m here to provide detailed examples or walk you through any of these methods. Just let me know how I can support you!
Sources: hooks/use-transcriber.ts | Text and transcriptions | LiveKit Docs | Text and transcriptions | LiveKit Docs | Docs::Agents | Session recording and transcripts | LiveKit Docsnice-room-70150
09/30/2025, 4:28 AMtall-airline-16756
09/30/2025, 4:28 AMon_interim_transcript function is designed to handle partial transcription results during real-time speech-to-text (STT) processing. Let me walk you through how it works:
• It kicks in whenever an INTERIM_TRANSCRIPT event comes in from the STT engine, like AssemblyAI, Google, or Deepgram.
• If you're using external transcription (such as through a Realtime LLM), it smartly skips sending out the STT-based transcription to prevent any duplicates.
• When it’s active, it sends out a UserInputTranscribed event with the transcript and isFinal: false, letting you know the transcription is still in progress and might be updated shortly.
• It also updates the internal state (like audioInterimTranscript) to help with real-time UI features, such as live captions or detecting interruptions.
• The interim transcript is then combined with finalized transcripts, giving you a smooth, continuously updated view of what the user is saying.
This setup really helps provide timely updates while keeping accuracy through a two-step transcription process (interim → final). If you'd like, I’m here to share more details or examples—just let me know!
Sources: livekit-plugins/livekit-plugins-cartesia/livekit/plugins/cartesia/stt.py | Speechmatics STT integration guide | LiveKit Docsnice-room-70150
09/30/2025, 5:37 AMtall-airline-16756
09/30/2025, 5:38 AMon_interim_transcript callback. The ElevenLabs STT plugin is set up with interim_results=True, which allows it to emit INTERIM_TRANSCRIPT events as speech is being recognized.
To get this working, you can implement the on_interim_transcript method within the RecognitionHooks interface. This method will receive a SpeechEvent object that contains the interim transcription data, accessible via ev.alternatives[0].text. Here's a simple example:
def on_interim_transcript(self, ev: stt.SpeechEvent, *, speaking: bool | None):
interim_text = ev.alternatives[0].text
# Handle real-time transcription updates
If you have any questions or would like some help setting this up, please don’t hesitate to reach out—I’m here to assist!
Sources: agents/src/stt/stt.ts | Working with plugins | LiveKit Docs | livekit-agents/livekit/agents/inference/stt.pynice-room-70150
09/30/2025, 5:40 AMtall-airline-16756
09/30/2025, 5:41 AMpip install "livekit-agents[elevenlabs]~=1.2" (Python)
pnpm add @livekit/agents-plugin-elevenlabs@1.x (Node.js)
2. Next, set your ElevenLabs API key as the environment variable ELEVEN_API_KEY.
3. Then, initialize TTS with your preferred settings, like voice_id, model, and language.
If you’d like, I’m here to help you with the implementation or provide any more details you might need—just let me know!
Sources: Docs::Agents | agents/src/inference/tts.ts | livekit-plugins/livekit-plugins-elevenlabs/README.md | Example Applications | livekit/livekit_composite | DeepWikinice-room-70150
09/30/2025, 5:42 AMtall-airline-16756
09/30/2025, 5:43 AMuse_tts_aligned_transcript=True in your AgentSession configuration.
If you're working with Python, you have a neat way to access word-level timing data by implementing the transcription_node method. This will give you TimedString objects with start_time and end_time for each word. Just a heads-up, this feature is still experimental, so it might evolve in future updates.
For those using Node.js, synchronized transcript forwarding is available, but direct access to word-level timing data isn’t supported just yet.
If you'd like, I’m here to help you set this up or clarify anything further—just let me know!
Sources: ElevenLabs TTS integration guide | LiveKit Docs | Docs::Agents | Docs::Agents | examples/other/text-to-speech/elevenlabs_tts.py | ElevenLabs TTS integration guide | LiveKit Docsnice-room-70150
09/30/2025, 5:47 AMtall-airline-16756
09/30/2025, 5:48 AMAgentSession with use_tts_aligned_transcript=True. This setting makes sure you receive word-level timing information that's perfectly synced with the speech playback.
In your agent code, you can handle this data by implementing the transcription_node method. Here's a simple example to guide you:
class MyAgent(Agent):
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):
logger.info(f"TimedString: '{chunk}' ({chunk.start_time} - {chunk.end_time})")
yield chunk
Just a quick note: this feature is still experimental and is currently supported only in Python. If you run into any questions or need a hand with anything else, please don’t hesitate to reach out—I’m here to help!
Sources: Text and transcriptions | LiveKit Docs | Docs::Agents | Text and transcriptions | LiveKit Docs | livekit-agents/livekit/agents/inference/tts.py | ElevenLabs TTS integration guide | LiveKit Docs