Skip to main content

Overview

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

Installation

To use Groq services, install the required dependencies:
pip install "pipecat-ai[groq]"

Prerequisites

Groq Account Setup

Before using Groq TTS services, you need:
  1. Groq Account: Sign up at Groq Console
  2. API Key: Generate an API key from your account dashboard
  3. Voice Selection: Choose from available voice models

Required Environment Variables

  • GROQ_API_KEY: Your Groq API key for authentication

Configuration

GroqTTSService

api_key
str
required
Groq API key for authentication.
model_name
str
default:"canopylabs/orpheus-v1-english"
TTS model to use.
voice_id
str
default:"autumn"
Voice identifier to use.
output_format
str
default:"wav"
Audio output format.
sample_rate
int
default:"48000"
Audio sample rate. Must be 48000 Hz for Groq TTS.
params
InputParams
default:"None"
Runtime-configurable voice settings. See InputParams below.

InputParams

Voice and generation settings that can be set at initialization via the params constructor argument.
ParameterTypeDefaultDescription
languageLanguageLanguage.ENLanguage for speech synthesis.
speedfloat1.0Speech speed multiplier.

Usage

Basic Setup

from pipecat.services.groq import GroqTTSService

tts = GroqTTSService(
    api_key=os.getenv("GROQ_API_KEY"),
    voice_id="autumn",
)

With Custom Settings

from pipecat.transcriptions.language import Language

tts = GroqTTSService(
    api_key=os.getenv("GROQ_API_KEY"),
    model_name="canopylabs/orpheus-v1-english",
    voice_id="autumn",
    params=GroqTTSService.InputParams(
        language=Language.EN,
        speed=1.2,
    ),
)

Notes

  • Fixed sample rate: Groq TTS only supports 48kHz sample rate. Setting a different value will produce a warning.
  • WAV output: The service outputs WAV-formatted audio, which is decoded internally to extract raw PCM frames.