Description
this is the program which i tried
import pyttsx3
engine = pyttsx3.init('sapi5')
engine.setProperty('volume', 1.0)
voices = engine.getProperty('voices')
print(voices[0].id)
engine.setProperty('voices',voices[0].id)
pyttsx3.speak("hello world")
getting an error in getproperty line as
File "C:\Users\Nivetha Linda\PycharmProjects\testproject\demo.py", line 8, in
voices = engine.getProperty('voices')
File "C:\Users\Nivetha Linda\AppData\Local\Programs\Python\Python310\lib\site-packages\pyttsx3\engine.py", line 146, in getProperty
return self.proxy.getProperty(name)
File "C:\Users\Nivetha Linda\AppData\Local\Programs\Python\Python310\lib\site-packages\pyttsx3\driver.py", line 173, in getProperty
return self._driver.getProperty(name)
File "C:\Users\Nivetha Linda\AppData\Local\Programs\Python\Python310\lib\site-packages\pyttsx3\drivers\sapi5.py", line 88, in getProperty
return [self._toVoice(attr) for attr in self._tts.GetVoices()]
File "C:\Users\Nivetha Linda\AppData\Local\Programs\Python\Python310\lib\site-packages\pyttsx3\drivers\sapi5.py", line 88, in
return [self._toVoice(attr) for attr in self._tts.GetVoices()]
File "C:\Users\Nivetha Linda\AppData\Local\Programs\Python\Python310\lib\site-packages\pyttsx3\drivers\sapi5.py", line 77, in _toVoice
return Voice(attr.Id, attr.GetDescription())
_ctypes.COMError: (-2147200966, None, (None, None, None, 0, None))
could some one help!! initially i changed the voice registry according to this website https://www.ghacks.net/2018/08/11/unlock-all-windows-10-tts-voices-system-wide-to-get-more-of-them/
but it dint work!!
then tried to uninstall and reinstall pyttsx3
then tried to system restore too! nothing worked and im desperate!!!
Activity