Search code examples
pythontext-to-speechpyttsx

Using 32 bit voices in pyttsx3


Is there a way to use 32 bit voices instead of 64 bit voices in pyttsx3? or with any other text to speech module?

I have tried editing the registry to move my 32 bit voice over to 64 bit, and I have gotten the voice to show up in the 64 bit sapi.cpl, however when I try to preview the voice I get an error saying "This voice cannot be played. Please try selecting another voice or selecting a different audio output device"

import pyttsx3

engine = pyttsx3.init()
voices = engine.getProperty('voices')
for voice in voices:
    print(voice, voice.id)
    engine.setProperty('voice', voice.id)
    engine.say("Hello World!")
    engine.runAndWait()
    engine.stop()

This code runs and speaks each voice I have fine until it reaches the voice I manually added as it doesn't read "Hello World", but does show the voice.id and name


Solution

  • I was able to do this by downloading balabolka, and the balabolka command line utility then calling the voice through the command prompt using os.system instead of pyttsx3