how to enable streaming in this? {"tts": "livekit...
# ask-ai
a
how to enable streaming in this? {"tts": "livekit.plugins.openai.tts.TTS", "attempt": 3, "streamed": false}
t
Thanks for reaching out, Aditya. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To enable streaming in your TTS configuration, you need to set the
use_streaming
parameter to
True
when initializing your TTS provider. Here's an example:
Copy code
super().__init__(
    capabilities=tts.TTSCapabilities(streaming=True),
    sample_rate=sample_rate,
    num_channels=1,
)
Please note that if you enable SSML support, streaming synthesis cannot be used simultaneously. Let me know if you need further assistance! Sources: GitHub::livekit::agents | livekit-plugins/livekit-plugins-google/livekit/pl... | TTSCapabilities | LiveKit Agents
a
how this streaaming option is used then?
t
Hey there! 👋 I wanted to chat with you about LiveKit's TTS streaming option. By default, it's already turned on—how convenient, right? But if you'd like to take the reins and configure it yourself, you can easily set the
use_streaming
parameter to
True
when you're setting up the TTS service. Here's a quick example to show you exactly how:
Copy code
super().__init__(
    capabilities=tts.TTSCapabilities(streaming=True),
    sample_rate=sample_rate,
    num_channels=1,
)
Just one small heads-up: if you're planning to use SSML (Speech Synthesis Markup Language), streaming synthesis won't work at the same time. No worries, though! If you're curious about anything or need a bit more help, I'm totally here for you. Just ask, and I'll be happy to walk you through it! 😊 Sources: GitHub::livekit::agents | livekit-plugins/livekit-plugins-google/livekit/pl...
a
but how does this option help?
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!