Murf AI TTS
The Murf AI TTS provider enables your agent to use Murf AI's high-quality text-to-speech models for generating natural, expressive voice output with advanced voice customization.
Installation
Install the Murf AI-enabled VideoSDK Agents package:
pip install "videosdk-plugins-murfai"
Importing
from videosdk.plugins.murfai import MurfAITTS, MurfAIVoiceSettings
Authentication
The Murf AI plugin requires a Murf AI API key.
Set MURFAI_API_KEY in your .env file.
Example Usage
from videosdk.plugins.murfai import MurfAITTS, MurfAIVoiceSettings
from videosdk.agents import CascadingPipeline
# Configure voice settings
voice_settings = MurfAIVoiceSettings(
pitch=0,
rate=0,
style="Conversational",
variation=1,
multi_native_locale=None
)
# Initialize the Murf AI TTS model
tts = MurfAITTS(
# When MURFAI_API_KEY is set in .env - DON'T pass api_key parameter
api_key="your-murfai-api-key",
region="US_EAST",
model="Falcon",
voice="en-US-natalie",
voice_settings=voice_settings,
enable_streaming=True
)
# Add tts to cascading pipeline
pipeline = CascadingPipeline(tts=tts)
note
When using .env file for credentials, don't pass them as arguments to model instances or context objects. The SDK automatically reads environment variables, so omit api_key, videosdk_auth, and other credential parameters from your code.
Configuration Options
api_key: Your Murf AI API key (can also be set via MURFAI_API_KEY environment variable)region: (str) The region code for API deployment (default:"US_EAST")- Available regions:
"GLOBAL","US_EAST","US_WEST","INDIA","CANADA","SOUTH_KOREA","UAE","JAPAN","AUSTRALIA","EU_CENTRAL","UK","SOUTH_AFRICA"
- Available regions:
model: (str) The Murf AI model to use (default:"Falcon")- Available models:
"Gen2","Falcon"
- Available models:
voice: (str) Voice ID to use for audio output (default:"en-US-natalie")voice_settings: (MurfAIVoiceSettings) Advanced voice configuration options:pitch: (int) Voice pitch adjustment, range varies by voice (default:0)rate: (int) Speech rate adjustment, range varies by voice (default:0)style: (str) Voice style/emotion (default:"Conversational")variation: (int) Voice variation for diversity (default:1)multi_native_locale: (str) Optional locale for multi-native voices (default:None)
enable_streaming: (bool) Enable WebSocket streaming for low latency. WhenFalse, uses HTTP chunked transfer (default:True)
Additional Resources
The following resources provide more information about using Murf AI with VideoSDK Agents SDK.
- Murf AI docs: Murf AI TTS docs.
Got a Question? Ask us on discord

