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
/
microsoft-speech.xml
20 lines (20 loc) · 2.95 KB
/
microsoft-speech.xml
1
<blocks app="Snap! 4.0, http://snap.berkeley.edu" version="1"><block-definition s="Listen for %'duration' seconds then %'handle response' but if error %'handle error'" type="command" category="sensing"><header></header><code></code><inputs><input type="%n"></input><input type="%cmdRing"></input><input type="%cmdRing"></input></inputs><script><custom-block s="run eCraft2Learn command %txt with %mult%s"><l>start_microsoft_speech_recognition_batch</l><list><block var="handle response"/><block var="handle error"/><block var="duration"/></list></custom-block></script></block-definition><block-definition s="Listen %'respond as heard' then finally %'handle response' but if nothing heard %'handle nothing said'" type="command" category="sensing"><header></header><code></code><inputs><input type="%cmdRing"></input><input type="%cmdRing"></input><input type="%cmdRing"></input></inputs><script><custom-block s="run eCraft2Learn command %txt with %mult%s"><l>start_microsoft_speech_recognition</l><list><block var="respond as heard"/><block var="handle response"/><block var="handle nothing said"/></list></custom-block></script></block-definition><block-definition s="run eCraft2Learn command %'command name' with %'inputs'" type="command" category="other"><header></header><code></code><inputs><input type="%txt"></input><input type="%mult%s"></input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>function_name</l><l>parameters</l></list><l>"use strict";
if (typeof ecraft2learn === 'object') {
 ecraft2learn.snap_context = this;
 ecraft2learn.run(function_name, parameters);
} else {
 var script = document.createElement("script");
 script.type = "text/javascript";
 script.src = "https://toontalk.github.io/ai-cloud/ecraft2learn.js";
 script.addEventListener('load', function () {
 ecraft2learn.snap_context = this;
 ecraft2learn.run(function_name, parameters);
 }.bind(this));
 document.head.appendChild(script);
}</l></block><list><block var="command name"/><block var="inputs"/></list></block></script></block-definition><block-definition s="call eCraft2Learn reporter %'reporter name' with %'inputs'" type="reporter" category="other"><header></header><code></code><inputs><input type="%txt"></input><input type="%mult%s"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>function_name</l><l>parameters</l></list><l>"use strict";
if (typeof ecraft2learn === 'object') {
 return ecraft2learn.run(function_name, parameters);
} else {
 alert("Any eCraft2Learn command must be run before the " + function_name + " reporter.");
 return 0;
}</l></block><list><block var="reporter name"/><block var="inputs"/></list></block></block></script></block-definition></blocks>