Model capabilities

Languages

LMNT's speech models fluently speak 20 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.

from lmnt import Lmnt
 
client = Lmnt()
text = 'Hello, welcome to the show.'
 
for language in ['en', 'fr', 'ja']:
    with client.speech.with_streaming_response.generate(
        text=text,
        voice='leah',
        language=language,
    ) as response:
        response.stream_to_file(f'{language}.mp3')

The output:

  • en.mp3 → spoken by a native English speaker.
  • fr.mp3 → spoken in English with a French accent.
  • ja.mp3 → spoken in English with a Japanese 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.

from lmnt import Lmnt
 
client = Lmnt()
text = 'Bonjour! Did you know that mariposa means butterfly in Spanish?'
 
for language in ['en', 'fr', 'es']:
    with client.speech.with_streaming_response.generate(
        text=text,
        voice='leah',
        language=language,
    ) as response:
        response.stream_to_file(f'{language}.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
Chinesezh
Dutchnl
Englishen
Frenchfr
Germande
Hindihi
Indonesianid
Italianit
Japaneseja
Koreanko
Polishpl
Portuguesept
Russianru
Spanishes
Swedishsv
Thaith
Turkishtr
Ukrainianuk
Urduur
Vietnamesevi

Next steps