def on_mouse_press(x, y, button, modifiers): if globalVars.listening == False: thread1 = thinkThread(1, "Thread-1") try: thread1.start() except: print("Error: unable to start thread") elif globalVars.listening == True: try: thread1.stop() globalVars.listening = False window.set_caption('Steve - Not Listening') extras.speak('"Not Listening"') except: print("Error Stopping Thread")
def run(self): globalVars.listening = True text = extras.recognize() commands.doCommand(text) globalVars.listening = False window.set_caption('Steve - Not Listening') return ()
def run(self): globalVars.listening = True text = extras.recognize() commands.doCommand(text) globalVars.listening = False window.set_caption('Steve - Not Listening') return()
import crabGLShapes as shape import SteveExtras as extras import SteveCommands as commands import threading import platform #key = pyglet.window.key #if symbol == key.SPACE: # glClearColor(0.0, 0.0, 0.0, 0.0) window = pyglet.window.Window(200, 60, style=pyglet.window.Window.WINDOW_STYLE_DIALOG) window.set_location(0, 30) window.set_caption('Steve - Not Listening') extras.speak('"Ready"') class thinkThread(threading.Thread): def __init__(self, threadID, name): threading.Thread.__init__(self) self.threadID = threadID self.name = name def run(self): globalVars.listening = True text = extras.recognize() commands.doCommand(text) globalVars.listening = False window.set_caption('Steve - Not Listening') return ()
import pyglet from pyglet.gl import * import crabGLShapes as shape import SteveExtras as extras import SteveCommands as commands import threading import platform #key = pyglet.window.key #if symbol == key.SPACE: # glClearColor(0.0, 0.0, 0.0, 0.0) window = pyglet.window.Window(200, 60, style=pyglet.window.Window.WINDOW_STYLE_DIALOG) window.set_location(0, 30) window.set_caption('Steve - Not Listening') extras.speak('"Ready"') class thinkThread(threading.Thread): def __init__(self, threadID, name): threading.Thread.__init__(self) self.threadID = threadID self.name = name def run(self): globalVars.listening = True text = extras.recognize() commands.doCommand(text) globalVars.listening = False window.set_caption('Steve - Not Listening') return() class crap():