how to control how big of a chunk is forwarded fro...
# ask-ai
f
how to control how big of a chunk is forwarded from llm to tts in livekit python library voice pipeline agent
t
Thanks for reaching out, Amjad. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! Could you share a bit more about what you're trying to do? For example: • Are you wanting to change the size of the text chunks you send to the TTS engine? • Do you need a hand with a particular setup or some code? • Are you working with a specific TTS engine or integration? The more details you can give, the better I can help you out!
f
I want to change the size of the text to ensure complete words are sent in hindi language with eleven labs tts
t
If you want to tweak the text chunk size for Hindi when using Eleven Labs TTS in LiveKit, you can do that easily with the
chunk_length_schedule
parameter. This lets you set chunk sizes in characters so that complete words are sent smoothly. Here’s a quick example:
Copy code
tts_11labs = elevenlabs.TTS(
    model="eleven_turbo_v2_5",
    voice_id="bIHbv24MWmeRgasZH58o",
    chunk_length_schedule=[80, 120, 200, 260],
    language="hi"
)
Some helpful things to keep in mind: • The
chunk_length_schedule
takes a list of numbers, each one representing how many characters per chunk—for example,
[80, 120, 200, 260]
. • Each chunk size should be between 50 and 500 characters. • Starting with a smaller chunk size can really help with syllable alignment in Hindi, making the speech sound more natural. If you have any questions or want me to walk you through it, just let me know—I’m here to help!