This repository has been archived by the owner on Jul 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
listen blocks.xml
1 lines (1 loc) · 1.98 KB
/
listen blocks.xml
1
<blocks app="Snap! 4.0, http://snap.berkeley.edu" version="1"><block-definition s="listen" type="command" category="sensing"><header></header><code></code><inputs></inputs><script><custom-block s="Listen then %cmdRing but if error %cmdRing"><block s="reifyScript"><script><block s="doSetVar"><l>last thing spoken</l><block var="spoken"/></block><block s="doBroadcast"><l>heard something</l></block><custom-block s="listen"></custom-block></script><list><l>spoken</l></list></block><block s="reifyScript"><script><block s="doSetVar"><l>speech recognition error</l><block var="error"/></block><block s="doBroadcast"><l>speech recognition error</l></block><block s="doIfElse"><block s="reportEquals"><block var="speech recognition error"/><l>no-speech</l></block><script><custom-block s="Speak %txt"><l>I didn't hear anything for a while. Bye. Click the green flag to start listening again..</l></custom-block><custom-block s="Stop speech recognition"></custom-block></script><script><custom-block s="Speak %txt"><block s="reportJoinWords"><list><l>There was an error. </l><block var="speech recognition error"/></list></block></custom-block><block s="bubble"><block s="reportJoinWords"><list><l>There was an error. </l><block var="speech recognition error"/></list></block></block><custom-block s="Speak %txt then %cmdRing"><l>Try again.</l><block s="reifyScript"><script><custom-block s="listen"></custom-block></script><list></list></block></custom-block></script></block></script><list><l>error</l></list></block></custom-block></script></block-definition><block-definition s="Listen then %'handle response' but if error %'handle error'" type="command" category="sensing"><header></header><code></code><inputs><input type="%cmdRing"></input><input type="%cmdRing"></input></inputs><script><custom-block s="run eCraft2Learn command %txt with %mult%s"><l>start_speech_recognition</l><list><block var="handle response"/><block var="handle error"/></list></custom-block></script></block-definition></blocks>