I was trying to use this code to convert text to speech with Python 3.4, but since my computer\'s main language is not English (I\'m using Win7x64) the voice and the accent
This works in python.
Feel free to make it more elegant.
import win32com.client as wincl
speaker_number = 1
spk = wincl.Dispatch("SAPI.SpVoice")
vcs = spk.GetVoices()
SVSFlag = 11
print(vcs.Item (speaker_number) .GetAttribute ("Name")) # speaker name
spk.Voice
spk.SetVoice(vcs.Item(speaker_number)) # set voice (see Windows Text-to-Speech settings)
spk.Speak("Hello, it works!")
This should also provide a general idea of how to translate from the SDK examples.