Akul-AI / rlvoice-1

An offline TTS engine for AkulAI and more.
Mozilla Public License 2.0
14 stars 3 forks source link

NameError after init engine #6

Closed llfstudyup1104 closed 7 months ago

llfstudyup1104 commented 11 months ago

Describe the bug NameError after init engine。 Error infor: NameError: name 'objc' is not defined. Did you mean: 'object'?

To Reproduce Steps to reproduce the behavior:

  1. pip install rlvoice-1 on local MacOS Sonama Version 14.0

  2. Import rlvoice and init the engine

    import rlvoice
    engine = rlvoice.init()
  3. See error info

    
    Traceback (most recent call last):
    File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/rlvoice/__init__.py", line 20, in init
    eng = _activeEngines[driverName]
          ~~~~~~~~~~~~~~^^^^^^^^^^^^
    File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/weakref.py", line 136, in __getitem__
    o = self.data[key]()
        ~~~~~~~~~^^^^^
    KeyError: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/rlvoice/init.py", line 22, in init eng = Engine(driverName, debug) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/rlvoice/engine.py", line 30, in init self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/rlvoice/driver.py", line 49, in init self._module = importlib.import_module(name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/rlvoice/drivers/nsss.py", line 13, in class NSSpeechDriver(NSObject): File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/rlvoice/drivers/nsss.py", line 14, in NSSpeechDriver @objc.python_method ^^^^ NameError: name 'objc' is not defined. Did you mean: 'object'?

Akul2010 commented 11 months ago

I'm not sure what could be the problem here. This was supposed to be fixed in PR #4. Is it possible you could try using some other engine while I see what the problem is?

mxdoerfler commented 10 months ago

Just opened the same issue #301 on the original branch. Have not been able to get it to run. Can try again with this version but seems the error message etc. is identical.

Akul2010 commented 10 months ago

Yes, I try to work on this in my free time but MacOS speech engine is infamously buggy lol.

Akul2010 commented 10 months ago

Hello @llfstudyup1104 , I have just made and released a new fix that I think might work. I noticed that the Foundation library was called, even though it wasn't imported. Please check to see if it works now, as I don't own a MacOS and can't check anything MacOS related.