Thanks to this program I've started to learn Python because I'm trying to create my own speech recognition files for my flighsims.
Until now I've used to do something like this:
Code: Select all
# ++++ CALL TANKER
if speech.said("tanker"):
tanker_call()
def tanker_call():
keyboard.setPressed(Key.Y)
Code: Select all
comms = ["option01","option02","option03","option04"]
Code: Select all
mic= keyboard.getKeyDown(Key.Home)
if starting:
something="none"
if mic & speech.said(something): #if the user press mic button and say "something"...
commsOption = comms.index(something)
sayMessage(commsOption)
def sayMessage(opt):
keys=[Key.D1,Key.D2,Key.D3,Key.D4,Key.D5,Key.D6,Key.D7,Key.D8,Key.D9,Key.D0]
keyboard.setPressed(keys[opt],True)
Thank you for your time.
Regards