Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error and Fix while trying to init NSSS engine using M2 Max Macbook Pro #16

Open
chuckpaulson opened this issue Sep 26, 2023 · 1 comment

Comments

@chuckpaulson
Copy link

Describe the bug
got error message after installing pyttsx4 and trying tp initialize the engine

To fix this bug, I did the following
cd ~/miniconda3/envs/whisper-pip/lib/python3.10/site-packages/pyttsx4/drivers
edit nsss.py to add the + line:

from objc import super
+import objc

That is, add the "import obj" line after the already present line "from objc import super"

To Reproduce
After installing pyttsx4 using the command:
pip install pyttsx4==3.0.15

I tried running it with:
import pyttsx4
engine = pyttsx4.init()

The last statement resultted in the error message:
File "/Users/charlespaulson/miniconda3/envs/whisper-pip/lib/python3.10/site-packages/pyttsx4/drivers/nsss.py", line 13, in
class NSSpeechDriver(NSObject):
File "/Users/charlespaulson/miniconda3/envs/whisper-pip/lib/python3.10/site-packages/pyttsx4/drivers/nsss.py", line 14, in NSSpeechDriver
@objc.python_method
NameError: name 'objc' is not defined. Did you mean: 'object'?

Expected behavior
I expected that statement to not give any error messages

Desktop (please complete the following information):

  • OS: Apple M2 Max MacBook Pro, Ventura 13.5.1
  • Chrome, Version 116.0.5845.110 (Official Build) (arm64)
@chuckpaulson chuckpaulson changed the title error trying to init NSSS engine using M2 Max Macbook Pro Error and Fix while trying to init NSSS engine using M2 Max Macbook Pro Sep 26, 2023
@xiendong
Copy link

@chuckpaulson adding the follow imports to nsss.py seem to work for me

import objc
from Foundation import NSObject

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants