Skip to content

Commit 7eb49a3

Browse files
committed
Set proxy status when saving to file
Pin pyobjc version to 9.0.1 Bump package version
1 parent 495ef91 commit 7eb49a3

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dependencies = [
55
"comtypes; platform_system == 'Windows'",
66
"pypiwin32; platform_system == 'Windows'",
77
"pywin32; platform_system == 'Windows'",
8-
"pyobjc>=2.4; platform_system == 'Darwin'",
8+
"pyobjc==9.0.1; platform_system == 'Darwin'",
99
"six"
1010
]
1111
description = "Text to Speech (TTS) library for Python 3. Works without internet connection or delay. Supports multiple TTS engines, including Sapi5, nsss, and espeak."

pyttsx3/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from .engine import Engine
44

5-
version = '3.4.0'
5+
version = '3.5'
66
_activeEngines = weakref.WeakValueDictionary()
77

88

pyttsx3/drivers/nsss.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import time
2-
31
# noinspection PyUnresolvedReferences
42
from AppKit import NSSpeechSynthesizer
53
from Foundation import *
@@ -141,10 +139,10 @@ def setProperty(self, name, value):
141139

142140
@objc.python_method
143141
def save_to_file(self, text, filename):
142+
self._proxy.setBusy(True)
143+
self._completed = True
144144
url = Foundation.NSURL.fileURLWithPath_(filename)
145145
self._tts.startSpeakingString_toURL_(text, url)
146-
# waits (for 1% of the length of text) the system to finish writing to the file system before continuing
147-
time.sleep(max(1.0, len(text) * 0.01))
148146

149147
def speechSynthesizer_didFinishSpeaking_(self, tts, success):
150148
if not self._completed:

0 commit comments

Comments
 (0)