pyttsx3 is able to speak, but cannot write to a file

61 Views Asked by At

I started to experiment with pyttsx3 and got a problem with it. When I use a simple 'say' command, everything works well but when I try to save the voice to a file, my script hangs and never comes back. Using Mac on Apple silicon, if it is relevant.

Not sure if I need to deliver example code, but here it is:

Works:

eng = pyttsx3.init()
eng.say('Hey')
eng.runAndWait()

Hangs in eternity:

eng = pyttsx3.init()
eng.save_to_file('Hey', 'hey.mp3')
eng.runAndWait()

I also at some point suspected if the file should be there for it to write in, and created an empty hey.mp3 for it by using touch, but still no luck.

0

There are 0 best solutions below