LiveKit and Murf
This is an official integration of Murf for LiveKit, a framework for building voice and multimodal conversational AI applications. You can install the Python package livekit-murf to use Murf as a TTS service in your LiveKit Agents, providing high-quality voice synthesis with real-time streaming capabilities.
Introduction to LiveKit
LiveKit is an open-source platform for building scalable, real-time voice and video applications. LiveKit Agents is a framework that simplifies the creation of conversational AI applications by providing a structured way to connect speech-to-text (STT), large language models (LLMs), and text-to-speech (TTS) services.
With the official Murf TTS integration for LiveKit Agents, you can build sophisticated voice applications that combine Murf’s natural-sounding voices with other AI services, creating end-to-end conversational experiences.
Features
The Murf TTS integration for LiveKit Agents provides a comprehensive set of features for building voice applications:
- High-Quality Voice Synthesis: Leverage Murf’s advanced TTS technology with access to over 150 voices across 35+ languages
- Real-time Streaming: WebSocket-based streaming for low-latency audio generation, perfect for interactive conversations
- Voice Customization: Control voice style, rate and pitch to match your application’s needs
- Multi-Language Support: Multiple languages and locales with native speaker quality
- Agent Framework Integration: Seamless integration with LiveKit’s Agent framework for building conversational AI
- Flexible Configuration: Comprehensive audio format and quality options including sample rate, channel type, and output formats
Compatibility
This integration requires livekit-agents >= 1.2.18. The examples use the modern AgentServer pattern which is available in recent versions of LiveKit Agents. For compatibility with other versions, please refer to the LiveKit Agents documentation.
Installation
You can install the Murf TTS integration for LiveKit Agents using several methods:
Using pip
The recommended way to install the package is using pip:
Using uv
If you’re using uv as your Python package manager:
From source
To install from source, clone the repository and install it in development mode:
Quick Start
Get Your Murf API Key
Before you can use the integration, you’ll need a Murf API key. Sign up at the Murf API Dashboard and generate your API key from the dashboard.
Basic Usage
Here’s a simple example of how to create a LiveKit Agent Worker with Murf TTS:
Complete Example with Custom Configuration
Here’s a more advanced example showing how to customize the Murf TTS configuration with metrics and error handling:
💡 Try it out: For complete working examples and deployment guides, check out the LiveKit Agents documentation. You can use the examples above as a starting point to build your own voice agents with Murf TTS.
Configuration
The murf.TTS class provides extensive configuration options to customize the voice output according to your needs.
TTS Parameters Reference
Example with Custom Configuration
You can customize various aspects of the voice output to match your application’s requirements:
Available Voices
Environment Variables
To keep your API keys secure, it’s recommended to use environment variables. Create a .env file in your project root:
Then load these variables in your Python code using python-dotenv:
Requirements
The Murf TTS integration for LiveKit Agents has the following requirements:
- Python >= 3.9
- livekit-agents >= 1.2.18
Make sure you have these dependencies installed before using the integration.
Support
If you encounter any issues or have questions about the integration:
- Email: support@murf.ai
- Website: Murf API
- Documentation: Murf API Documentation
- Issues: GitHub Issues
Contributing
Contributions to the integration are welcome! If you’d like to contribute, please feel free to submit a Pull Request on the GitHub repository.
License
This project is licensed under the MIT License. See the LICENSE file for details.