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 voice.id: # The Polish voice. print(voice.id) # Full ID string. print("Languages for voice:") print(voice.languages) synthesizer.setProperty("language", "pl_PL") synthesizer.setProperty("voice", "com.apple.speech.synthesis.voice.zosia" ) synthesizer.say("Cześć, jak się masz?") synthesizer.runAndWait()