diff --git a/pyproject.toml b/pyproject.toml index b885c57..f44fd33 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ dependencies = [ "comtypes; platform_system == 'Windows'", "pypiwin32; platform_system == 'Windows'", "pywin32; platform_system == 'Windows'", - "pyobjc>=2.4; platform_system == 'Darwin'", + "pyobjc==9.0.1; platform_system == 'Darwin'", "six" ] description = "Text to Speech (TTS) library for Python 3. Works without internet connection or delay. Supports multiple TTS engines, including Sapi5, nsss, and espeak." diff --git a/pyttsx3/__init__.py b/pyttsx3/__init__.py index 3b05b89..9eb0e31 100644 --- a/pyttsx3/__init__.py +++ b/pyttsx3/__init__.py @@ -2,7 +2,7 @@ from .engine import Engine -version = '3.4.0' +version = '3.5' _activeEngines = weakref.WeakValueDictionary() diff --git a/pyttsx3/drivers/nsss.py b/pyttsx3/drivers/nsss.py index 08a78f6..6243fd7 100644 --- a/pyttsx3/drivers/nsss.py +++ b/pyttsx3/drivers/nsss.py @@ -1,5 +1,3 @@ -import time - # noinspection PyUnresolvedReferences from AppKit import NSSpeechSynthesizer from Foundation import * @@ -141,10 +139,10 @@ def setProperty(self, name, value): @objc.python_method def save_to_file(self, text, filename): + self._proxy.setBusy(True) + self._completed = True url = Foundation.NSURL.fileURLWithPath_(filename) self._tts.startSpeakingString_toURL_(text, url) - # waits (for 1% of the length of text) the system to finish writing to the file system before continuing - time.sleep(max(1.0, len(text) * 0.01)) def speechSynthesizer_didFinishSpeaking_(self, tts, success): if not self._completed: