I'm trying to use windows SAPI from python for Text-to-Spech purposes. And I'm totally new with win32com package. With English language everything is ok.
import win32com.client
speaker = win32com.client.Dispatch("SAPI.SpVoice")
speaker.Speak("Hello!")
But for other languages not.
# that code doesn't work
import win32com.client
speaker = win32com.client.Dispatch("SAPI.SpVoice")
speaker.Speak("Привет!")
I googled example on VB which uses "Speech.SpVoice" and it works only with Russian language.(this is what I need to)
CreateObject("Speech.SpVoice").Speak"Привет!"
I tried use "Speech.SpVoice" but in fails
import win32com.client
speaker = win32com.client.Dispatch("Speech.SpVoice")
speaker.Speak("Привет!")
#pywintypes.com_error: (-2147221164, 'Class not registered', None, None)
What the difference between "Speech.SpVoice" and "SAPI.SpVoice"? Why can't I use "Speech.SpVoice" instead of "SAPI.SpVoice" with python and win32com?
Or how can I run VB oneliner without creating vbs file? That will be the solution for me to.