WebkitSpeechRecognition

javadoc

WebkitSpeechRecognition - uses the speech recognition that is built into the chrome web browser

!!! * this service requires the webgui to be running on chrome web browser*!!!

 

Examples:


#file : service/WebkitSpeechRecognition.py edit raw
#########################################
# WebkitSpeechRecognition.py
# more info @: http://myrobotlab.org/service/WebkitSpeechRecognition
# you need chrome browser as default
#########################################

# Start the WebGui service without starting the browser
WebGui = Runtime.create("WebGui","WebGui")
WebGui.autoStartBrowser(False)
WebGui.startService()

# Then start the browsers and show the WebkitSpeechRecognition service named webkitspeechrecognition
WebGui.startBrowser("http://localhost:8888/#/service/webkitspeechrecognition")
webkitspeechrecognition = Runtime.start("webkitspeechrecognition","WebkitSpeechRecognition")
webkitspeechrecognition.setLanguage("en")

# start mouth
marySpeech = Runtime.start("marySpeech", "MarySpeech")

# shutdown microphone if robot speaking
webkitspeechrecognition.addMouth(marySpeech)

# auto rearm microphone
webkitspeechrecognition.setAutoListen(False)

# speedup recognition if False
webkitspeechrecognition.setContinuous(False)

def lightOn():
  marySpeech.speakBlocking("light is on")

def lightOff():
  marySpeech.speakBlocking("light is off")

def onText(data):
     print data
     if (data == "light on"):
         lightOn()
     elif (data == "light off"):
         lightOff()

webkitspeechrecognition.addListener("publishText","python","onText")

dom14's picture

webkitspeechrecognition

Dear,

Where can i found documentation for this service ?

webkitspeechrecognition = Runtime.start("webkitspeechrecognition","WebkitSpeechRecognition")

Thank you,

Dom