> `use_tts_aligned_transcript` is enabled but n...
# ask-ai
l
use_tts_aligned_transcript
is enabled but no agent transcript was returned from tts
getting this warning after upgrading from 1.2.6 to 1.2.11
t
Thanks for reaching out, Lawrence. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hi there! That warning
use_tts_aligned_transcript is enabled but no agent transcript was returned from tts
pops up when the
use_tts_aligned_transcript
setting is turned on, but the TTS engine doesn’t provide a transcript. This might happen if your TTS provider doesn’t support aligned transcripts, sends back an empty transcript, or works in a mode where timed transcripts aren’t available. Here are a few friendly tips to help you fix this: • Make sure your TTS provider supports aligned transcription. Providers like Cartesia and ElevenLabs work well with this feature. • Double-check that your TTS instance is set up properly to return aligned transcripts. • If your TTS provider doesn’t support this, you can simply turn off the setting by setting
use_tts_aligned_transcript=False
in your configuration—this will stop the warning from showing up. If having alignment isn’t super important for what you’re doing, it’s totally okay to ignore the warning. But just so you know, turning off the flag is a good way to keep your logs nice and clean. Sources: livekit-agents/livekit/agents/voice/agent.py | Text and transcriptions | LiveKit Docs | Cartesia TTS integration guide | LiveKit Docs | ElevenLabs TTS integration guide | LiveKit Docs
l
i’m using Eleven Labs
t
It’s great that you’re using ElevenLabs, which supports aligned transcription! The warning you’re seeing might be due to a small configuration hiccup or a temporary issue with the TTS service. Let’s try checking a few things together: • Make sure the ElevenLabs TTS instance is properly initialized and set up to return aligned transcripts. • Double-check that the TTS service isn’t running in a mode where aligned transcripts aren’t available (like some streaming modes). • Take a look at any error messages or logs from the ElevenLabs TTS service—they might give clues about why the transcript wasn’t returned. If everything looks good on your end but the problem continues, please don’t hesitate to reach out. I’m here to help you dig deeper and get this sorted out!
l
can you point me to docs? i had a working Eleven Labs configuration with this option on before, and no problem
t
I'm happy to guide you through the steps and documentation for setting up ElevenLabs TTS with `use_tts_aligned_transcript`: 1. First, please make sure you've installed the ElevenLabs plugin by running:
pip install "livekit-agents[elevenlabs]~=1.2"
. 2. Next, don’t forget to set your
ELEVEN_API_KEY
in the
.env
file so the system can authenticate properly. 3. Then, you can use the following configuration in your
AgentSession
to get started:
Copy code
from livekit.plugins import elevenlabs
from livekit.agents import AgentSession

session = AgentSession(
    tts=elevenlabs.TTS(
        voice_id="YOUR_VOICE_ID", 
        model="eleven_multilingual_v2"
    ),
    use_tts_aligned_transcript=True,
)
If you want to work with the timing data programmatically, you can create a
transcription_node
method in your agent. This method helps you handle
TimedString
objects, which include detailed word-level timing information:
Copy code
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.text}' ({chunk.start_time}s - {chunk.end_time}s)")
        yield chunk
For any more details or if you run into questions, feel free to reach out! I’m here to help you every step of the way. Sources: Docs::Agents | Text and transcriptions | LiveKit Docs | Docs::Agents | Cartesia TTS integration guide | LiveKit Docs | Cartesia TTS integration guide | LiveKit Docs
l
oh it’s only happening in console
t
It sounds like the warning you’re seeing is just a console message and isn’t impacting how things are working, which is a good sign! Sometimes this happens if the TTS service has a brief hiccup or certain settings cause no aligned transcript to be returned for a request. If you’d like to keep your console a little cleaner, you can tweak the logging level in your app to hide these less critical messages. But if everything with the aligned transcription is running smoothly, you’re totally safe to just ignore this warning. Please feel free to reach out if you’d like a hand with changing the logging settings or if you start noticing anything unusual related to this warning—I’m here to help!
l
by “console” i mean specifically the console mode in the livekit CLI. do you know why that happens? something is initialized differently in that mode?
t
Thank you for your question! The LiveKit CLI console mode actually doesn’t initialize differently based on the
use_tts_aligned_transcript
setting or the TTS provider, like ElevenLabs. Instead, the console mode kicks in through a specific CLI argument (
cli.CLI_ARGUMENTS.console
) during
AgentSession.start()
, and this happens independently from the TTS configuration. The
use_tts_aligned_transcript
setting is a separate feature flag that manages transcription synchronization, and it relies on the capabilities of your TTS provider. Since ElevenLabs supports aligned transcripts, this feature should work smoothly. That said, if you’re seeing a warning in console mode, it might mean the TTS service didn’t return a transcript for a particular request — this can happen due to temporary issues or certain configurations. If everything works fine outside of console mode, this could just be a logging quirk related to how the CLI handles output. Please feel free to reach out if you’d like me to help you dig deeper into this — I’m here to support you! Sources: livekit-agents/livekit/agents/inference/tts.py | Text and transcriptions | LiveKit Docs | ElevenLabs TTS integration guide | LiveKit Docs