Overview

Groq’s TTS API provides fast text-to-speech synthesis with multiple voice options. The service operates at a fixed 48kHz sample rate and offers efficient audio streaming for real-time applications.

Installation

To use Groq services, install the required dependencies:
pip install "pipecat-ai[groq]"
You’ll also need to set up your Groq API key as an environment variable: GROQ_API_KEY.
Get your API key by signing up at Groq Console.

Frames

Input

  • TextFrame - Text content to synthesize into speech
  • TTSSpeakFrame - Text that should be spoken immediately
  • TTSUpdateSettingsFrame - Runtime configuration updates
  • LLMFullResponseStartFrame / LLMFullResponseEndFrame - LLM response boundaries

Output

  • TTSStartedFrame - Signals start of synthesis
  • TTSAudioRawFrame - Generated audio data chunks (WAV format)
  • TTSStoppedFrame - Signals completion of synthesis
  • ErrorFrame - API or processing errors

Voice Models

Groq TTS supports various voice options through the PlayAI model:
Voice IDDescriptionGender
Celeste-PlayAINatural, conversational voiceFemale
Iris-PlayAIProfessional, clear voiceFemale
Oliver-PlayAIWarm, friendly voiceMale
William-PlayAIAuthoritative, confident voiceMale
Voice availability may vary. Check the Groq documentation for the latest available voices.

Audio Configuration

Sample Rate

  • Fixed at 48kHz - Groq TTS only supports 48,000 Hz sample rate
  • Automatic resampling if pipeline uses different rates

Usage Example

Basic Configuration

Initialize GroqTTSService and use it in your pipeline:
from pipecat.services.groq.tts import GroqTTSService
from pipecat.transcriptions.language import Language
import os

# Configure service
tts = GroqTTSService(
    api_key=os.getenv("GROQ_API_KEY"),
    model_name="playai-tts",
    voice_id="Celeste-PlayAI",
    params=GroqTTSService.InputParams(
        language=Language.EN,
        speed=1.0
    )
)

# Use in pipeline
pipeline = Pipeline([
    transport.input(),
    stt,
    context_aggregator.user(),
    llm,
    tts,
    transport.output(),
    context_aggregator.assistant()
])

Dynamic Configuration

Make settings updates by pushing a TTSUpdateSettingsFrame for the GroqTTSService:
from pipecat.frames.frames import TTSUpdateSettingsFrame

await task.queue_frame(
    TTSUpdateSettingsFrame(settings={"voice": "your-new-voice-id"})
)

Metrics

The service provides comprehensive metrics:
  • Time to First Byte (TTFB) - Latency from text input to first audio
  • Processing Duration - Total synthesis time
Learn how to enable Metrics in your Pipeline.

Additional Notes

  • Fixed Sample Rate: Service operates at 48kHz only - resampling handled automatically
  • Speed Control: Adjust speech rate from 0.5x to 2.0x normal speed