Javadoc link

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*!!!

 

Example code (from branch develop):
#########################################
# 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.setcurrentWebkitLanguage("en-US")
 
# 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

6 years ago

Dear,

Where can i found documentation for this service ?

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

Thank you,

Dom

Example configuration (from branch develop):
!!org.myrobotlab.service.config.WebkitSpeechRecognitionConfig
listening: false
peers: null
recording: false
textListeners: null
type: WebkitSpeechRecognition
wakeWord: null