Overview
MistralTTSService provides text-to-speech synthesis using Mistral’s Voxtral TTS API. It uses HTTP streaming with Server-Sent Events to generate PCM-encoded audio at 24kHz.
Key features include:
- Streaming TTS with real-time audio generation
- Automatic resampling to pipeline sample rate
- Built-in metrics support
- Multiple voice options
Mistral TTS API Reference
Pipecat’s API methods for Mistral TTS
Example Implementation
Complete example with Mistral STT and TTS
Mistral Documentation
Official Mistral API documentation
Installation
To use Mistral TTS service, install the required dependencies:Prerequisites
Before usingMistralTTSService, you need:
- Mistral Account: Sign up at Mistral AI
- API Key: Generate an API key from your account dashboard
- Model Access: Ensure you have access to the Voxtral TTS API
Required Environment Variables
MISTRAL_API_KEY: Your Mistral API key for authentication
Configuration
Mistral API key for authentication.
Output audio sample rate in Hz. Audio is resampled from Mistral’s native 24kHz
when a different rate is requested. When
None, uses the pipeline’s
configured sample rate.Runtime-configurable settings for the TTS service. See Settings
below.
Settings
Runtime-configurable settings passed via thesettings constructor argument using MistralTTSService.Settings(...). These can be updated mid-conversation with TTSUpdateSettingsFrame. See Service Settings for details.
| Parameter | Type | Default | Description |
|---|---|---|---|
model | str | "voxtral-mini-tts-2603" | Mistral TTS model to use. (Inherited.) |
voice | str | None | Voice identifier. (Inherited.) |
language | Language | str | None | Language for synthesis. (Inherited.) |
Available Voices
Mistral provides built-in voices grouped by language. Thevoice setting accepts
either the slug (e.g. fr_marie_neutral) or the UUID.
You can always retrieve the latest list of voices via the Mistral API:
voice setting, for example:
fr_marie_neutral and UUID example: 5a271406-039d-46fe-835b-fbbb00eaf08d can both be used as the voice identifier in the service settings.
Usage
Basic Setup
With a Built-in Voice
With a Custom Voice
If you have created a custom voice in your Mistral account, use its UUID as thevoice identifier:
With Custom Sample Rate
Notes
- Audio format conversion: The Mistral API returns base64-encoded float32 PCM chunks via Server-Sent Events. The service automatically converts these to int16 PCM for the Pipecat pipeline.
- Native sample rate: Mistral’s TTS API outputs audio at 24kHz. When a different sample rate is specified, the service automatically resamples the audio.
- Streaming: The service uses HTTP streaming with Server-Sent Events for real-time audio generation, allowing for low-latency synthesis.
- Voice identifiers: Both slugs (e.g.
fr_marie_neutral) and UUIDs are accepted. Built-in voice slugs are listed in the Available Voices section. Custom voices created in your Mistral account dashboard are referenced by their UUID.