glamorous-oil-12326
10/18/2025, 12:24 AMtall-airline-16756
10/18/2025, 12:24 AMtall-airline-16756
10/18/2025, 12:25 AMFallbackAdapter to keep track of which provider is active and dynamically apply the SSML rules specific to that provider.
• Create a custom wrapper for each TTS provider to handle the SSML transformations before sending the text along to the provider.
• Use these wrappers within your fallback configuration to make sure each provider gets the SSML formatted just right.
If you don’t mind sharing which TTS providers you’re working with and the kinds of SSML transformations you need, I’d be happy to offer more tailored advice to help you out.
Sources: Cartesia TTS plugin guide | LiveKit Docs | Agent speech and audio | LiveKit Docs | livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/tts.p... | ElevenLabs TTS plugin guide | LiveKit Docs | Google Cloud TTS integration guide | LiveKit Docsglamorous-oil-12326
10/18/2025, 12:26 AMtall-airline-16756
10/18/2025, 12:28 AM<phoneme> and <speak>, which you can use to control pronunciation. Simply wrap your text with these tags before sending it to the TTS engine.
• Rime: This one uses bracket notation (for example, [phonetic]) for custom pronunciations, but make sure the phonemizeBetweenBrackets parameter is enabled. This way, you can directly define phonetic strings within your text.
To put this into practice in your TTS node, you might want to create some custom logic that applies different transformations depending on which provider is active. Here's a little example to illustrate:
def custom_tts_node(agent, original_tts):
async def tts_node(text: str):
if isinstance(original_tts, CartesiaTTS):
text = f"<speak>{text}</speak>"
elif isinstance(original_tts, RimeTTS):
text = text.replace("LiveKit", "[ˈlaɪvkɪt]")
return await original_tts.synthesize(text)
return tts_node
If you have any questions or need a hand with the implementation or specific SSML rules, please don’t hesitate to reach out—I’m here to help!
Sources: Cartesia TTS plugin guide | LiveKit Docs | livekit-agents/livekit/agents/inference/tts.py | plugins/cartesia/src/tts.test.ts | Rime TTS plugin guide | LiveKit Docs | Agent speech and audio | LiveKit Docs