Hi there! How can I get text transcript of speech ...
# ask-ai
n
Hi there! How can I get text transcript of speech to speech models integration so I can save the interaction with the agent?
t
Thanks for reaching out, Kevin. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm happy to help you get a text transcript of your speech-to-speech model interactions using LiveKit's built-in transcription features. Here's a simple guide to walk you through it: • Enable Transcription: First, make sure transcription is turned on in your
AgentSession
by setting
transcription_enabled=True
in
RoomOutputOptions
. This step is key to getting those transcripts. • Access Realtime Transcripts: You can then access the transcriptions as they stream over the
lk.transcription
text stream topic, which syncs nicely with audio playback by default. • Disable Synchronization (Optional): If you'd prefer to receive transcriptions immediately without waiting for sync, just set
sync_transcription=False
in
RoomOutputOptions
. • Retrieve Full History: To look back at the entire conversation, including all transcriptions, simply use
session.history
. • Realtime Monitoring: Stay updated by listening for events like
user_input_transcribed
and `conversation_item_added`—they let you know when new transcriptions come in. For a more detailed synchronization experience, you can enable
use_tts_aligned_transcript=True
in the Python SDK to get word-level timing with supported TTS providers. If you'd like, I’m here to provide more details or examples—just let me know! Sources: Docs::Agents | Session recording and transcripts | LiveKit Docs | Speech-to-text (STT) integrations | LiveKit Docs | main.py