prehistoric-printer-73777
08/15/2025, 1:41 PMtall-airline-16756
08/15/2025, 1:41 PMtall-airline-16756
08/15/2025, 1:42 PMTTS
class and implement the methods needed for text synthesis. Here’s a simple example to give you an idea:
from livekit.agents import tts
class CustomTTS(tts.TTS):
def __init__(self, **kwargs):
super().__init__(sample_rate=24000, num_channels=1)
# Set up any custom TTS service configurations here
async def synthesize(self, text: str) -> tts.ChunkedStream:
# Add your logic to convert text to speech with your custom TTS
# Don’t forget to return a ChunkedStream with the audio data
pass
This way, you have the freedom to plug in any TTS service that works best for you. If you want, I’m here to help walk you through the next steps!
Sources: Text-to-speech (TTS) integrations | LiveKit Docs