Synthesize Speech in a Different Language using Python

To synthesize speech in Python in a language other than English using pyttsx3, we need to find which voice is available for the desired language.

First, we can print out the list of all available voices.
Each of the voice objects will include a list of languages that the voice supports (usually one).

In this example we will synthesize a string in Polish. For other languages other than English, simply find the voice which supports that language in the full output list of voices.


import pyttsx3

synthesizer = pyttsx3.init()

voices = synthesizer.getProperty("voices")

for voice in voices:
  if "zosia" in # The Polish voice.
    print( # Full ID string.
    print("Languages for voice:")

synthesizer.setProperty("language", "pl_PL")


synthesizer.say("Cześć, jak się masz?")


Leave a Reply

Your email address will not be published. Required fields are marked *