square-yacht-21107
10/26/2025, 11:04 PMtall-airline-16756
10/26/2025, 11:04 PMtall-airline-16756
10/26/2025, 11:04 PMsquare-yacht-21107
10/26/2025, 11:05 PMtall-airline-16756
10/26/2025, 11:06 PMsay-as tag. Here's a simple example for you:
<say-as interpret-as="characters">LiveKit</say-as>
This will have the agent pronounce each letter separately, like "L-I-V-E-K-I-T."
If you'd like more examples or need any extra help, just let me know—I'm here for you!
Sources: Cartesia TTS plugin guide | LiveKit Docs | Agent speech and audio | LiveKit Docs | Text and transcriptions | LiveKit Docssquare-yacht-21107
10/26/2025, 11:09 PMtall-airline-16756
10/26/2025, 11:10 PMpip install livekit-plugins-cartesia. This will set up everything you need.
2. Next, make sure to add your API key to the .env file like this: CARTESIA_API_KEY=your_cartesia_api_key. This lets the agent connect smoothly.
3. Then, configure your agent to use Cartesia TTS. Here’s a friendly example to guide you:
from livekit.agents.voice import Agent
from livekit.plugins import cartesia
class SpellingAgent(Agent):
def __init__(self):
super().__init__(
instructions="You are a helpful assistant that can spell out words clearly.",
tts=cartesia.TTS(
sample_rate=44100,
model="sonic-2",
voice="87bc56aa-ab01-4baa-9071-77d497064686"
)
)
When you want to spell out words, you can use SSML with the say-as tag like this:
<say-as interpret-as="characters">LiveKit</say-as>
This will help the agent pronounce each letter one by one, making things crystal clear. If you have any questions or need a hand with anything else, just let me know—I’m here to help!
Sources: Cartesia TTS plugin guide | LiveKit Docs | pipeline-tts/tts_comparison/README.md | Agent speech and audio | LiveKit Docs | examples/voice_agents/timed_agent_transcript.pysquare-yacht-21107
10/26/2025, 11:11 PMtall-airline-16756
10/26/2025, 11:11 PMsession.say() method. Here’s a little example to guide you:
from livekit.agents.voice import AgentSession
from livekit.plugins import cartesia
# Create session with Cartesia TTS
session = AgentSession(
tts=cartesia.TTS()
)
# Make the agent say a word or phrase
session.say("Hello")
This method takes care of the TTS synthesis and audio playback for you, so you don’t have to worry about the details. If you have any questions or want to explore more, just let me know—I’m here to help!
Sources: Cartesia TTS plugin guide | LiveKit Docs | Agent speech and audio | LiveKit Docs | examples/src/custom_text_handler.ts | basics/repeater.py | examples/voice_agents/timed_agent_transcript.pysquare-yacht-21107
10/26/2025, 11:12 PMtall-airline-16756
10/26/2025, 11:12 PMsay-as tag. Here’s a little example for you:
await session.say('')
This will guide the agent to pronounce each letter one by one, like "L-I-V-E-K-I-T."
If you have any more questions or need a hand with anything else, please don’t hesitate to reach out—I’m here to help!square-yacht-21107
10/26/2025, 11:12 PMtall-airline-16756
10/26/2025, 11:12 PMlanguage parameter to "de" when you initialize the TTS instance. Here’s a little example to help you out:
from livekit.plugins import cartesia
tts = cartesia.TTS(
language="de" # Sets the language to German
)
This way, your text-to-speech will beautifully speak in German. If you have any questions or need a hand with anything else, just let me know—I’m here to help!
Sources: livekit-plugins/livekit-plugins-cartesia/README.md | Cartesia TTS plugin guide | LiveKit Docs | Cartesia TTS | LiveKit Docs