Exemplo n.º 1
0
def check_context():
    global in_command_context
    if speech_system.engine and speech_system.engine.name == "dragon":
        if "user.command_mode" in registry.tags:
            if in_command_context: return
            speech_system.engine_mimic("switch to command mode")
            in_command_context = True
        else:
            if not in_command_context: return
            speech_system.engine_mimic("switch to normal mode")
            in_command_context = False
Exemplo n.º 2
0
 def dragon_mimic(phrase: str):
     """mimic"""
     print(phrase)
     speech_system.engine_mimic(phrase)
Exemplo n.º 3
0
from talon import Context, speech_system, actions
from talon_plugins import speech

ctx = Context()

def set_enabled(value):
    ctx.exclusive = not value
    actions.speech.toggle(value)

ctx.commands = {
    'talon sleep': lambda m: set_enabled(False),
    'talon wake': lambda m: set_enabled(True),

    'dragon mode': [lambda m: set_enabled(False), lambda m: speech_system.engine_mimic('wake up'.split())],
    'talon mode': [lambda m: set_enabled(True), lambda m: speech_system.engine_mimic('go to sleep'.split())],
}
Exemplo n.º 4
0
 def engine_mimic(cmd: str):
     """Sends phrase to engine"""
     speech_system.engine_mimic(cmd)
Exemplo n.º 5
0
 def engine_wake():
     """Wake the engine"""
     speech_system.engine_mimic("wake up"),
Exemplo n.º 6
0
 def engine_sleep():
     """Sleep the engine"""
     speech_system.engine_mimic("go to sleep"),
Exemplo n.º 7
0
from talon import Context, speech_system, actions
from talon_plugins import speech

ctx = Context()


def set_enabled(value):
    ctx.exclusive = not value
    actions.speech.toggle(value)


ctx.commands = {
    'talon sleep':
    lambda m: set_enabled(False),
    'talon wake':
    lambda m: set_enabled(True),
    'dragon mode': [
        lambda m: set_enabled(False),
        lambda m: speech_system.engine_mimic('wake up'.split())
    ],
    'talon mode': [
        lambda m: set_enabled(True),
        lambda m: speech_system.engine_mimic('go to sleep'.split())
    ],
}
Exemplo n.º 8
0
 def sleep():
     speech_system.engine_mimic("go to sleep")
Exemplo n.º 9
0
 def engine_mimic(phrase: str):
     """Force the engine to mimic a phrase"""
     speech_system.engine_mimic(phrase)