can i use neuphonic open source tts in livekit?
# ask-ai
s
can i use neuphonic open source tts in livekit?
t
Thanks for reaching out, Abdullah. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm glad you're exploring options with LiveKit's open-source plugins to integrate with Neuphonic TTS. These plugins are thoughtfully provided under the Apache 2.0 license for both Python and Node.js environments, which is great for flexibility. Just a heads-up, the Neuphonic TTS service itself is a commercial API, so you'll need an API key to access it, and there may be some usage costs involved. If you're interested in a fully open-source TTS solution, please feel free to let me know—I’d be more than happy to help you find the right fit. Or, if you're leaning towards using Neuphonic’s commercial service, I can definitely guide you through the setup process to make it as smooth as possible. Sources: examples/other/text-to-speech/neuphonic_tts.py | README.md | Neuphonic TTS plugin guide | LiveKit Docs
s
i have it on my local machine and need guidance on how to implement it in livekit
t
I'm glad you're interested in integrating your local TTS system with LiveKit! To help you get started, here’s a friendly, step-by-step guide to make the process smoother: 1. Set Up Your TTS Engine: First, make sure your local TTS engine can output audio in a format that LiveKit supports, such as the right sample rate and number of channels. This will help everything work seamlessly. 2. Create a TTS Adapter: You’ll want to build a class that includes methods like
stream()
for streaming synthesis or
synthesize()
for batch synthesis. This adapter will take care of turning your text input into audio frames. 3. Integrate with LiveKit: Next, use LiveKit's
rtc.AudioSource
to capture those audio frames from your TTS engine and publish them as a track in your LiveKit room. This is where your TTS really comes to life! 4. Handle Text Input: Implement helpful methods like
push_text()
to queue up text for synthesis, and
end_input()
to signal when you’re done sending text. 5. Test and Optimize: Finally, give everything a good test to make sure the audio plays smoothly. You might want to fine-tune for latency or audio quality to get the best experience. If you’d like, feel free to share more about your local TTS engine—whether it’s Coqui TTS, Festival, eSpeak, or something else—and the audio format it uses. That way, I can offer you more tailored advice or even some code snippets to help along the way. I’m here to support you every step of the journey! Sources: Text-to-speech (TTS) models | LiveKit Docs | Pipeline nodes and hooks | LiveKit Docs | livekit-plugins/livekit-plugins-speechify/livekit/plugins/speechify/tts.py