Model capabilities

Languages

LMNT's speech models fluently speak 31 languages with native code-switching.

How native language prompting works

By default, the model looks at your text and guesses the native language for your generated speech. But you can explicitly prompt the model for more control.

This shapes the accent and how the model handles foreign words.

import asyncio
 
from lmnt import AsyncLmnt
 
async def main():
  client = AsyncLmnt()
  text = 'Hello, and uh, welcome to the show.'
 
  for language in ['en', 'fr', 'de']:
    async with client.speech.with_streaming_response.generate(
      text=text,
      voice='leah',
      language=language,
    ) as response:
      await response.stream_to_file(f'{language}.mp3')
 
asyncio.run(main())
de.mp3
en.mp3
fr.mp3

The output:

  • en.mp3 → spoken by a native English speaker.
  • fr.mp3 → spoken in English with a French accent.
  • de.mp3 → spoken in English with a German accent.

Code switching

Code switching is mixing text from two or more of the model's supported languages into the same text prompt, and is fully supported.

import asyncio
 
from lmnt import AsyncLmnt
 
async def main():
  client = AsyncLmnt()
  text = 'Bonjour! Did you know that mariposa means butterfly in Spanish?'
 
  for language in ['en', 'fr', 'es']:
    async with client.speech.with_streaming_response.generate(
      text=text,
      voice='leah',
      language=language,
    ) as response:
      await response.stream_to_file(f'{language}.mp3')
 
asyncio.run(main())
en.mp3
es.mp3
fr.mp3

The output:

  • en.mp3 → English speaker — Bonjour and mariposa sound foreign.
  • fr.mp3 → French speaker — butterfly and mariposa sound foreign.
  • es.mp3 → Spanish speaker — Bonjour and butterfly sound foreign.

Use native scripts

Our models have been trained on native scripts for all supported languages.

For languages with non-Latin scripts, write your text in the language's native script. Romanized or transliterated text may not always be pronounced as you'd expect.

Supported languages

LanguageCode
Arabicar
Assameseas
Bengalibn
Chinesezh
Czechcs
Danishda
Dutchnl
Englishen
Finnishfi
Frenchfr
Germande
Hindihi
Indonesianid
Italianit
Japaneseja
Koreanko
Malayalamml
Marathimr
Polishpl
Portuguesept
Russianru
Slovaksk
Spanishes
Swedishsv
Tamilta
Telugute
Thaith
Turkishtr
Ukrainianuk
Urduur
Vietnamesevi

Next steps