Groq TTS
The Groq TTS provider enables your agent to use Groq's high-quality text-to-speech models for generating natural-sounding voice output.
Installation
Install the Groq-enabled VideoSDK Agents package:
pip install "videosdk-plugins-groq"
Importing
from videosdk.agents.plugins import GroqTTS
Authentication
The Groq plugin requires an Groq API key.
Set GROQ_API_KEY in your .env file.
Example Usage
from videosdk.agents.plugins import GroqTTS
from videosdk.agents import Pipeline
# Initialize the Groq AI TTS model
tts = GroqTTS(
model="playai-tts",
voice="Fritz-PlayAI",
)
# Add tts to pipeline
pipeline = Pipeline(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 and other credential parameters from your code.
Configuration Options
model(str): The TTS model to use. Default: "canopylabs/orpheus-v1-english"voice(str): The voice to use. Default: "hannah"speed(float): Speed of speech (0.5 to 5.0). Default: 1.0response_format(str): The response format. One of "flac", "mp3", "mulaw", "ogg", "wav". Default: "wav"sample_rate(int): The sample rate. Must be one of 8000, 16000, 22050, 24000, 32000, 44100, 48000. Default: 24000api_key(str, optional): Groq API key. If not provided, uses GROQ_API_KEY environment variable
Additional Resources
The following resources provide more information about using Groq with VideoSDK Agents SDK.
- Groq docs: Groq TTS docs.
Got a Question? Ask us on discord

