Voxtral Speech TTS in Node.js
Voxtral Speech 3 reads the answers of your agent in more than 35 languages, with preset voices or a voice cloned from a few seconds of audio. The speech endpoint reads a whole text at once, so MistralTTS cuts the answer into sentences and sends the audio of each one as Mistral streams it. A sentence starts playing in about half a second and is generated several times faster than it is spoken, so the next one is ready before the current one ends.
Installation
npm install @micdrop/mistralThe same package also provides an agent and a speech to text. The providers page shows what every provider covers.
Usage with MicdropServer
import { MistralTTS } from '@micdrop/mistral'import { MicdropServer } from '@micdrop/server'
const tts = new MistralTTS({ apiKey: process.env.MISTRAL_API_KEY || '', model: 'voxtral-mini-tts-3-0', // Default model voiceId: 'voice_592', // Marie, French})
new MicdropServer(socket, { tts, // ... other options})Usage without MicdropServer
import { MistralTTS } from '@micdrop/mistral'import { Readable } from 'stream'
const tts = new MistralTTS({ apiKey: process.env.MISTRAL_API_KEY || '' })
// Audio is raw PCM, 16 bits, 16 kHz, monotts.on('Audio', (chunk) => console.log('Audio:', chunk.length, 'bytes'))tts.on('Failed', (texts) => console.error('Failed:', texts))
tts.speak(Readable.from(['Hello! ', 'What can I do for you?']))Events
| Event | Payload | Description |
|---|---|---|
Audio | Buffer | A chunk of audio, PCM 16 bits, 16 kHz, mono, ready to be played. |
Failed | string[] | Synthesis gave up after an error, with the text that stayed unspoken. |
See the TTS interface for the full contract.
Options
| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | Required | Your Mistral AI API key |
model | string | 'voxtral-mini-tts-3-0' | Speech model to use |
voiceId | string | 'voice_3150' | Preset voice, or the id of a voice saved in your Mistral account |
refAudio | string | undefined | A few seconds of speech to clone, base64 encoded, used over voiceId |
settings | Record<string, unknown> | undefined | Extra fields of the request body, such as phoneme_hints |
baseUrl | string | 'https://api.mistral.ai' | API address, such as https://api.eu.mistral.ai to stay in Europe |
Voxtral Speech 3 costs $13 per million characters.
Voices
Each preset voice has a native language and reads the others too. The full list comes from GET /v1/audio/voices on the Mistral API.
| Voice | Name | Language |
|---|---|---|
voice_3150 | James | en-US |
voice_478 | Sheila | en-US |
voice_3149 | Hugo | en-GB |
voice_590 | Harriet | en-GB |
voice_592 | Marie | French |
voice_3141 | Camille | French |
voice_3137 | Manon | French |
voice_589 | Lea | French |
voice_481 | Heidi | German |
voice_483 | Elena | Spanish |
voice_482 | Lorenzo | Italian |
voice_480 | Gabriela | Portuguese |
Mistral also offers voices in Arabic, Catalan, Hindi, Japanese, Korean, Dutch, Polish, Russian, Chinese and more. The Voxtral 2 voices, such as gb_jane_neutral or fr_marie_happy, still work.
The text can carry emotion and pace tags such as [emotion=...], which Voxtral Speech 3 performs rather than reads out. Ask your agent to write them in its system prompt.