Skip to content

Instantly share code, notes, and snippets.

@acotilla91
Created June 3, 2018 19:38
Show Gist options
  • Save acotilla91/052f0df4e719b35a85c1d37cea23e697 to your computer and use it in GitHub Desktop.
Save acotilla91/052f0df4e719b35a85c1d37cea23e697 to your computer and use it in GitHub Desktop.
function recognizer()
if m.recognizer = invalid
m.recognizer = CreateObject("roSGNode", "SpeechRecognizer")
m.recognizer.delegate = m.top
end if
return m.recognizer
end function
function onKeyEvent(key as String, press as Boolean) as Boolean
if key = "OK" and press
recognizer().callFunc("startListening", {})
m.infoLb.text = "Listening..."
m.label.text = ""
end if
return true
end function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment