pyttsx3 icon indicating copy to clipboard operation
pyttsx3 copied to clipboard

Adding More Voice to sapi5

Open kevalrajpalknight opened this issue 4 years ago • 1 comments

Hello, I really appreciate your contribution to Python. I am using a windows machine and I have installed more voices other than the defaults i.e. David, Zira, and Hazel. Can you help me how I can add more voice to sapi5.py file?

kevalrajpalknight avatar Mar 31 '20 09:03 kevalrajpalknight

Hey I don't know of a slick solution just yet but I found this thread: https://stackoverflow.com/questions/31167967/python-3-4-text-to-speech-with-sapi

describing how to go into the registry and do some string copying in order to show SAPI where the other voices are.

The only difference in that tutorial is that my original audio was found here:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech_OneCore\Voices\Tokens

I took the name + attribute keys and manually typed them over into

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens

So my original folder in

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens looked like:

Tokens
TTS_MS_EN-GB_HAZEL_11.0 TTS_MS_EN-US_DAVID_11.0 TTS_MS_EN-US_ZIRA_11.0

Then after follow the guide from stackoverflow I copied the name + contents from the

Speech_OneCore\Voices\Tokens section

new Tokens folder in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens looked like:

Tokens
TTS_MS_EN-AU_CatherineM TTS_MS_EN-GB_HAZEL_11.0 TTS_MS_EN-US_DAVID_11.0 TTS_MS_EN-US_ZIRA_11.0

Now I am able to voice added voice using pyttsx3.engine.getProperty('voices')

somewhatrobotic avatar Sep 15 '20 07:09 somewhatrobotic