🎤Micdrop

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

Terminal window
npm install @micdrop/mistral

The 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, mono
tts.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

EventPayloadDescription
AudioBufferA chunk of audio, PCM 16 bits, 16 kHz, mono, ready to be played.
Failedstring[]Synthesis gave up after an error, with the text that stayed unspoken.

See the TTS interface for the full contract.

Options

OptionTypeDefaultDescription
apiKeystringRequiredYour Mistral AI API key
modelstring'voxtral-mini-tts-3-0'Speech model to use
voiceIdstring'voice_3150'Preset voice, or the id of a voice saved in your Mistral account
refAudiostringundefinedA few seconds of speech to clone, base64 encoded, used over voiceId
settingsRecord<string, unknown>undefinedExtra fields of the request body, such as phoneme_hints
baseUrlstring'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.

VoiceNameLanguage
voice_3150Jamesen-US
voice_478Sheilaen-US
voice_3149Hugoen-GB
voice_590Harrieten-GB
voice_592MarieFrench
voice_3141CamilleFrench
voice_3137ManonFrench
voice_589LeaFrench
voice_481HeidiGerman
voice_483ElenaSpanish
voice_482LorenzoItalian
voice_480GabrielaPortuguese

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.