Accents from voice prompts
LMNT's models excel at voice cloning, so the accents in your voice prompts carry forward to your generated speech. You don't have to do anything special - this works out of the box.
Learn more about how to craft great voice prompts in our Voice prompting guide.
Changing accents
You can prompt the model to change accents on the fly by changing the language option. This results in speech that sounds distinctly like your voice prompt, but also now
with an accent of someone who has been speaking that language for a long time.
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.