Text to speech using python on mac m2 chip

224 views Asked by At

Not a pro with python but trying to build stuff to add to my resume. Im following a tutorial on building a "JARVIS". I'm getting an error when trying to execute:

[Code issue](https://i.stack.imgur.com/kN7Mm.jpg)

I have tried to reinstall pyttsx3 and speech recognition. I am on 3.11 because i was having issues with 3.12 getting pyaudio to install. right now i am stuck. I used Chatgpt to help me solve it but nothing was getting me anywhere. I also ran across some stuff on here but nothing was pointing me in the right step.

Thanks for the assistance!

1

There are 1 answers

2
Z9. On

I believe the issue is here: engine = pyttsx3.init()

You need to specify which driver module to load: in order to do this, replace the line with engine = pyttsx3.init('nsss') as 'nsss' is the module for MacOS computers

more info: https://pyttsx3.readthedocs.io/en/latest/engine.html