Skip to content

@mrmekon /ttsxtest.py
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
PyTTSX problem with GTK and threading
import threading
import pyttsx
import objc
from Foundation import *
from PyObjCTools import AppHelper
import gobject
shouldUseThreads = True
if shouldUseThreads:
import gtk
gobject.threads_init()
class Test:
def __init__(self):
self.thread = threading.Thread(target=self.run)
def start(self):
self.thread.start()
def run(self):
pool = NSAutoreleasePool.alloc().init()
engine = pyttsx.Engine()
while True:
text = "Say something, say something, anything."
engine.say(text)
engine.runAndWait()
del pool
t = Test()
if shouldUseThreads:
t.start()
gtk.main()
else:
t.run() # this works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.