Appearance
Magpie TTS Multilingual: Text-to-Speech API ​
Overview ​
Magpie TTS Multilingual is NVIDIA's multilingual text-to-speech synthesis model that converts text into natural-sounding speech. The model supports 9 languages with multiple voice options, making it suitable for diverse international use cases.
Key Features ​
- Provider: NVIDIA
- Stage: Preview (available from May 7th, 2026)
- Languages: 9 supported languages (see table below)
- Voice Options: Multiple voices per language
- Audio Output:
- Offline endpoint: WAV file format
- Streaming endpoint: RAW PCM stream (22050Hz, mono, 16-bit)
Supported Languages ​
| Language | Code |
|---|---|
| English | en-US |
| Spanish | es-US |
| French | fr-FR |
| German | de-DE |
| Mandarin | zh-CN |
| Italian | it-IT |
| Vietnamese | vi-VN |
| Hindi | hi-IN |
| Japanese | ja-JP |
Voice Parameter ​
The optional voice parameter allows you to select specific voice characteristics. Voice names follow the format: Magpie-Multilingual.{LANG_CODE}.{VoiceName}
For a complete list of available voices, see the NVIDIA Speech Support Matrix.
Example: Magpie-Multilingual.EN-US.Aria
Model Card: Magpie TTS Multilingual
Endpoints ​
1. Create Speech Synthesis (Offline) ​
POST /v1/audio/synthesize
Description ​
Synthesizes complete audio file from text input. Returns a WAV file.
Request Fields (form-data) ​
| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | The text to synthesize into speech |
model | string | Yes | Model ID: magpie-tts-multilingual |
language | string | Yes | Language code in ISO format (e.g., en-US, de-DE) |
voice | string | No | Voice name (e.g., Magpie-Multilingual.EN-US.Aria). If not specified, a default voice is used |
Response ​
Content-Type: audio/wav
Binary WAV file containing the synthesized speech.
2. Create Speech Synthesis Online (Streaming) ​
POST /v1/audio/synthesize_online
Description ​
Synthesizes audio in real-time with streaming response. Returns RAW PCM audio stream suitable for immediate playback.
Request Fields (form-data) ​
| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | The text to synthesize into speech |
model | string | Yes | Model ID: magpie-tts-multilingual |
language | string | Yes | Language code in ISO format (e.g., en-US, de-DE) |
voice | string | No | Voice name (e.g., Magpie-Multilingual.EN-US.Aria). If not specified, a default voice is used |
Response ​
Content-Type: audio/pcm
Streaming RAW PCM audio (22050Hz sample rate, mono channel, 16-bit depth).
Example Code Snippets ​
Note:
The production URL for this API is available in the corresponding plan for this model in the Digital Marketplace. To retrieve the URL:
- Navigate to the Digital Marketplace.
- Go to the Documentation section.
- Select the plan associated with the
Magpie TTS Multilingualmodel.- Locate the production URL provided in the plan details.
- Set up the environment variable
API_URLto the production URL retrieved.
1. Using curl ​
Offline Synthesis ​
bash
curl -X POST $API_URL/v1/audio/synthesize \
-H "Authorization: Bearer $YOUR_API_KEY" \
-F "text=Hello, this is a TTS test" \
-F "model=magpie-tts-multilingual" \
-F "language=en-US" \
-F "voice=Magpie-Multilingual.EN-US.Aria" \
-o output.wavStreaming Synthesis ​
bash
curl -X POST $API_URL/v1/audio/synthesize_online \
-H "Authorization: Bearer $YOUR_API_KEY" \
-F "text=Hello, this is streaming TTS!" \
-F "model=magpie-tts-multilingual" \
-F "language=en-US" \
-F "voice=Magpie-Multilingual.EN-US.Aria" \
-o streaming-output.raw2. Using Python ​
Offline Synthesis ​
python
import requests
# Configuration
CONFIG = {
'url': '$API_URL/v1/audio/synthesize',
'headers': {
'Authorization': 'Bearer $YOUR_API_KEY',
},
'data': {
'text': 'Hello, this is a TTS test',
'model': 'magpie-tts-multilingual',
'language': 'en-US',
'voice': 'Magpie-Multilingual.EN-US.Aria',
}
}
# Request
response = requests.post(CONFIG['url'], headers=CONFIG['headers'], data=CONFIG['data'])
response.raise_for_status()
# Save to file
with open('output.wav', 'wb') as f:
f.write(response.content)
print("Audio saved to output.wav")Streaming Synthesis ​
python
import requests
from requests_toolbelt.multipart.encoder import MultipartEncoder
import pyaudio
# Configuration
CONFIG = {
'url': 'https://<URL>/v1/audio/synthesize_online',
'headers': {
'Authorization': 'Bearer <TOKEN>',
},
'data': {
'text': 'Hello, this is streaming TTS!',
'model': 'magpie-tts-multilingual',
'language': 'en-US',
},
'sample_rate': 22050,
'audio_format': pyaudio.paInt16,
'channels': 1,
}
# Initialize PyAudio
p = pyaudio.PyAudio()
stream = p.open(
format=CONFIG['audio_format'],
channels=CONFIG['channels'],
rate=CONFIG['sample_rate'],
output=True,
frames_per_buffer=4096
)
# Create multipart encoder
multipart_data = MultipartEncoder(fields=CONFIG['data'])
headers = CONFIG['headers'].copy()
headers['Content-Type'] = multipart_data.content_type
# Stream and play
response = requests.post(
CONFIG['url'],
headers=headers,
data=multipart_data,
stream=True
)
response.raise_for_status()
print("Streaming TTS audio...")
# Accumulator buffer for smooth playback
# Prevents audio glitches from variable-sized network chunks
audio_buffer = b''
PLAY_BLOCK_SIZE = 4096
for chunk in response.iter_content(chunk_size=4096):
if chunk:
# Accumulate incoming chunks
audio_buffer += chunk
# Write fixed-size blocks for consistent playback
while len(audio_buffer) >= PLAY_BLOCK_SIZE:
stream.write(audio_buffer[:PLAY_BLOCK_SIZE])
audio_buffer = audio_buffer[PLAY_BLOCK_SIZE:]
# Drain remaining buffer
if audio_buffer:
stream.write(audio_buffer)
# Cleanup
stream.stop_stream()
stream.close()
p.terminate()📦 Requirements
pip install requests pyaudio requests-toolbelt
Replace $YOUR_API_KEY with your actual API key to authenticate the requests. You can follow the procedure in Inference Endpoints Overview

