-
Notifications
You must be signed in to change notification settings - Fork 344
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
AttributeError: 'NSSpeechDriver' object has no attribute '_current_text' #361
Comments
ok - mind giving me a code snippet fully on this? I have a feeling we have fixed this just not pushed a new release |
Hey, here's a minimal snippet that triggers the original error for me:
giving:
|
Yeah ok - definitely then. thanks for confirming that - I can confirm we have fixed this already - just not released. Just give us a small while to release.. we have some snags with espeak that I'd love to fix first. Apologies.. Use the github url for the pip install if you are in a hurry. Sorry ! |
great that seems to work, thanks for your help! I'll use this and keep an eye out for the update - should we close this now or wait until the fix is published? |
lets keep it open.. you never know it might take me forever to get espeak working against all our new tests! its looking that way.. |
We are saving pyttsx3/pyttsx3/drivers/nsss.py Line 157 in d212b16
This causes us to skip this test on macOS. Line 39 in d212b16
Converting a If the eSpeak-NG driver was used on macOS instead of NSSpeechSynthesizer, the file would probably be a .wav. |
Yeah - I felt uncomfortable adding a big dependency like pydub or ffmpeg.. What if we just dealt with it.. so end user save_to_file('file.wav") nsss-> file.aiff ? Or - check of ffmpeg installed - then output to wav. But dont add as a depenency - |
https://docs.python.org/3.12/library/aifc.html was removed in Python 3.13 as a dead battery https://peps.python.org/pep-0594/#aifc Will we have identical problems with AVSynth https://developer.apple.com/documentation/avfaudio/avaudiofile ? |
OOh i have a feeling we wont - but will need to bear this in mind. |
Thanks both - yeah I noticed that my files were actually |
Ask ChatGPT: |
Not sure if this will help you but I had the same problem and got around it by doing this
|
@cclauss @nateshmbhat i think we should do a release from main and then triage bugs. Any thoughts? (Nb. There WILL be bugs. ) |
Sounds good @willwade. |
just held up with a ton of stuff at work. will check this hopefully in a day or 2. |
On the |
I have published the current master branch to https://test.pypi.org/project/pyttsx3/2.99/ |
@nateshmbhat this is working for me on Mac OS 14.2 and Windows 10 |
Nice work! |
@nateshmbhat I did come across a problem on MacOS from a fresh virtual environment:
if i |
That’s interesting. It’s not that bad you’ve got to install pyobjc but that’s fixable. I really must check Linux and windows. @cclauss are the tests working ok on this? What’s failing? Something must be (Nb. I’m tied up a bit at the moment. Family health crisis stuff. Will try and look as quick as I can ) |
https://pypi.org/project/pyobjc is v10.3.2 but I but https://test.pypi.org/project/pyobjc is a 404 Error. |
@cclauss ah - seems likely to be the issue! |
@cclauss yes, so install with
works fine as it gets the this suggests tom me if |
@willwade were u able to test it in linux and windows ? |
I confirmed 2.99 worked for me on Windows, Linux and MacOS if that's helpful? |
Is there anything I can do to help get this on regular PyPI? |
Sorry! So my bad! Basically. Run it all on windows. Run the tests. See if anything breaks. I’m sure it will. I’ve just been swamped with death in family stuff and various work crap.. |
It is super helpful. Can you run the tests and see if anything breaks? |
@willwade Sorry to hear it - hope things calm down for you. Thanks for the direction I've been able to run the tests. 5 of the tests are not skipped on which 2 of them fail, with I should note I'm not sure where the branch representing `pytest` output
|
@james-trayford On the machines where you run pytest, can you try Do you need espeak or would the default Windows voices ( The title of this issue is about |
@cclauss It's not installed atm so I just get
No I don't need
yes - apologies - @nateshmbhat 's v2.99 fixed my original |
Given it's working in the |
Hi, I've hit a problem trying to use
pyttsx3
for speech synthesis on Mac OSX Sonoma 14.2I can get the say function to run ok, but when I try the
engine.save_to_file()
method, this crashes onengine.runAndWait()
with the error:AttributeError: 'NSSpeechDriver' object has no attribute '_current_text'
(see trace at bottom). However, the output file appears to produce successfully.If I catch this error in a
try
block, I can get my application to run first time and have the audio file I need, but I think this leaves the NSSS engine in an abortive state - If i run again I get the Errorrun loop already started
. I've tried also adding:to try and force stop the loop but I get
Stopper already registered for this runLoop
.Grateful for any insight!
Trace:
The text was updated successfully, but these errors were encountered: