nateshmbhat / pyttsx3

Offline Text To Speech synthesis for python
Mozilla Public License 2.0
1.99k stars 321 forks source link

getproperty issue #315

Open lindawilliam6 opened 3 weeks ago

lindawilliam6 commented 3 weeks ago

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!!!