Closed ghost closed 3 weeks ago
I spent a lot of time trying to figure out how to deal with it. First, I get code here to know what voices it has recognized, and compare it to the voice list in Windows Settings > Time & Language > Speech.
I notice that some voice I need is in path 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech_OneCore\Voices\Tokens\' while the pyttsx3 read path is 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\‘ in regedit , and then I try to specify the path directly to Speech_OneCore in voice property, but it's doesn't work.
So finally, I found a solution here, he's method is copy the registry entries which needed in to two other path.(‘HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\’ and HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\SPEECH\Voices\Tokens\'').
An additional point to note is that some sounds use other files for their VoicePath, you may open 'C:\Windows\Speech_OneCore\Engines\TTS' to see the corresponding name, and edit VoicePath in regedit path where added.
eng = pyttsx3.init("sapi5") voices = eng.getProperty('voices') bot.setProperty('voices', voices[1].id) // used bot.setProperty('voices', voices[0].id) used this but voice keeps on male only not able to switch voice as per requirement
Pretty sure this is fixed. Anyone reopen if you see this again. Thanks all
Hi sir ,i am also facing the same problem , here is the code that I ran in vscode
And here is the error that I got
I am using windows 7 version and programming in vscode Here is the screen shot also
And voices[0] which is to change voice to that of a male , is in return returning a female voice.