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
/
speak Mary TTS.xml
24 lines (24 loc) · 34.8 KB
/
speak Mary TTS.xml
1
2
3
4
5
6
7
8
9
<project name="speak Mary TTS" app="Snap! 4.1, http://snap.berkeley.edu" version="1"><notes></notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAAFiUlEQVR4Xu2ZSyjmXxjHH5eVhRnXDWUsSFITpZRirBSyFRvZYCNLC1MSkpRZ2NvYm9mwdc2CIiVZuSwol2IlFO+/c+qd/C/z5533N3OeeZ/P2by3c87zPN/vp3P5vWmxWCwmNBQIpEAaAAZSnrBeAQAEhKAKAGBQ+QkOgDAQVAEADCo/wQEQBoIqAIBB5Sc4AMJAUAUAMKj8BAdAGAiqAAAGlZ/gAAgDQRUAwKDyExwAYSCoAgAYVH6CAyAMBFUAAIPKT3AAhIGgCgBgUPkJDoAwEFQBAAwqP8EBEAaCKgCAQeUnOADCQFAFADCo/AQHQBgIqgAABpWf4AAIA0EVAMCg8hMcAGEgqAIAGFR+ggMgDARVAACDyk9wAISBoAoAYFD5CQ6AMBBUAQAMKj/BARAGgioAgEHlJzgAwkBQBQAwqPwEB0AYCKoAAAaVn+AACANBFQDACOS/vb2Vk5MTubm5iWC216coKiqS8vLy1zv+AT0AMEmTHHy7u7tSVVUlBQUFSc72tuEHBwdyf38vNTU1bxuguBcAJmmOg8+tSIWFhUnOlNjwvb09ef/+vZSUlCQ2UFlvAEzSkOXlZWlqakpylsSHHx8f+0GlpaWJD1Y0AgCTNCMO4NLSkrS0tPxrtru7O9na2hL3+l+/vxywuLgora2t/quVlRVZXV2V5uZmqaur+/758+fPkpGRIQCYpHGpMtwBWFlZKe3t7TI+Pi4bGxt+RXSvubm58uHDB5menvZnxPz8fMnKyvLnt/r6etnf35ezszOZmpqSubk5mZ+fFzefa+7VnfFmZ2fFQecgnpmZ8X3dtguAqUJQknXEV8CBgQHJy8uTtLQ0aWho8BcTB9jo6KiH6/r62gPY1dUlfX198vHjR/ny5YsMDQ15qFxzfUdGRvz7y8tLD9/Y2Jj//PXrV8nMzPTA9vf3A2CSvqXM8DiADh4H3tramjQ2Nvrt07Xh4WGZmJiQ2tpav/pVV1fLt2/f/Crm+rjVcHJy8vu2++nTp79twW4u9118Sx4cHPSXD1bAlEEouUJ+9hISByoOWKJZAGCiiqVo/8PDQ3l+fvbnwN/Ztre3payszK+Gf3LjFhyBezs7O/5mmp2dLTk5OR6KWCzm/x35Fc2dD9+9eycVFRW/YvrfOicARiT36empHB0d+TOeg889KHYPqN3FIeoWhzzqeUPMB4A/UH1hYUGurq6kra3Ng/RaOz8/l4uLC0lPT5fHx8eU2B5fqzmK3wHwByo+PDxId3e3uFe35bn3T09P0tvb67fbf7bNzU3ft7i42MNHe5sCAPg/Oq2vr/vncu689bK5fzV6enr8VtvZ2Slu9XPP51LhUvA2bKLrBYA/AaB7dudWRPfQuaOjIzo3DM4EgG/Ygt1Z8OUW7M55tGgUAMCILiHR2GFvFgC057mqigFQlR32kgFAe56rqhgAVdlhLxkAtOe5qooBUJUd9pIBQHueq6oYAFXZYS8ZALTnuaqKAVCVHfaSAUB7nquqGABV2WEvGQC057mqigFQlR32kgFAe56rqhgAVdlhLxkAtOe5qooBUJUd9pIBQHueq6oYAFXZYS8ZALTnuaqKAVCVHfaSAUB7nquqGABV2WEvGQC057mqigFQlR32kgFAe56rqhgAVdlhLxkAtOe5qooBUJUd9pIBQHueq6oYAFXZYS8ZALTnuaqKAVCVHfaSAUB7nquqGABV2WEvGQC057mqigFQlR32kgFAe56rqhgAVdlhLxkAtOe5qooBUJUd9pIBQHueq6oYAFXZYS8ZALTnuaqKAVCVHfaSAUB7nquqGABV2WEvGQC057mqigFQlR32kgFAe56rqhgAVdlhLxkAtOe5qooBUJUd9pIBQHueq6oYAFXZYS8ZALTnuaqK/wLFQiLG/aM92AAAAABJRU5ErkJggg==</thumbnail><stage name="Stage" width="480" height="360" costume="0" tempo="60" threadsafe="false" lines="round" ternary="true" codify="false" inheritance="true" sublistIDs="false" scheduled="false" id="1"><pentrails>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAAOhUlEQVR4Xu3VwQkAAAjEMN1/abewn7jAQRC64wgQIECAAIF3gX1fNEiAAAECBAiMAHsCAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQIHLFxAWmhEwHPAAAAAElFTkSuQmCC</pentrails><costumes><list id="2"></list></costumes><sounds><list id="3"></list></sounds><variables></variables><blocks></blocks><scripts></scripts><sprites><sprite name="Sprite" idx="1" x="0" y="0" heading="90" scale="1" rotation="1" draggable="true" costume="0" color="80,80,80" pen="tip" id="8"><costumes><list id="9"></list></costumes><sounds><list id="10"></list></sounds><blocks></blocks><variables></variables><scripts><script x="100" y="150"><custom-block s="Speak (using Mary TTS) %txt with voice %n at %n volume %cmdRing"><l>testing 1 2 3</l><l>0</l><l>1</l><block s="reifyScript"><script><block s="bubble"><l></l></block></script><list></list></block></custom-block></script><script x="91" y="239"><custom-block s="Get Mary TTS voices"></custom-block></script><script x="99" y="278"><custom-block s="Get Mary TTS voice name %n"><l>3</l></custom-block></script></scripts></sprite></sprites></stage><hidden></hidden><headers></headers><code></code><blocks><block-definition s="Speak (using Mary TTS) %'message' with voice %'voice number' at %'volume' volume %'do when finished'" type="command" category="sound"><comment x="0" y="0" w="375" collapsed="false">Says message using 'voice number'. 'Volume' is between 0 and 1. If provided will run the blocks in 'do when finished' when speech has completed.</comment><header></header><code></code><inputs><input type="%txt"></input><input type="%n"></input><input type="%n"></input><input type="%cmdRing"></input></inputs><script><custom-block s="run eCraft2Learn command %txt with %mult%s"><l>speak_using_mary_tts</l><list><block var="message"/><block var="volume"/><block var="voice number"/><block var="do when finished"/></list></custom-block></script></block-definition><block-definition s="Listen %'respond as heard' then finally %'handle response' but if nothing heard %'handle nothing said' (requires Microsoft speech key)" type="command" category="sensing"><comment x="0" y="0" w="352.00000000000006" collapsed="false">As speech is recognised 'respond as heard' is called with what it thinks it has heard. 'handle response' is called when it thinks the speaking is finished.</comment><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="read URL %'URL' then %'receive contents' or if error %'receive error' using an access key if needed %'key'" type="command" category="sensing"><comment x="0" y="0" w="383" collapsed="false">Reads the contents of 'URL' and then calls 'receive contents' with that text (in HTML). If there was an error 'receive error' is called instead. 'key' needs only be provided if the URL requires as access key.</comment><header></header><code></code><inputs><input type="%txt"></input><input type="%cmdRing"></input><input type="%cmdRing"></input><input type="%txt"></input></inputs><script><custom-block s="run eCraft2Learn command %txt with %mult%s"><l>read_url</l><list><block var="URL"/><block var="receive contents"/><block var="receive error"/><block var="key"/></list></custom-block></script></block-definition><block-definition s="Setup camera %'width' %'height'" type="command" category="other"><comment x="0" y="0" w="197" collapsed="false">Must be run before any of the image recognition blocks. Specifies the resolution of the image sent for recogntion.</comment><header></header><code></code><inputs><input type="%n"></input><input type="%n"></input></inputs><script><custom-block s="run eCraft2Learn command %txt with %mult%s"><l>setup_camera</l><list><block var="width"/><block var="height"/></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="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 for a number %'what to do with the number' %'what to do if not a number'" type="command" category="sensing"><header></header><code></code><inputs><input type="%cmdRing"></input><input type="%cmdRing"></input></inputs><script><custom-block s="Listen then %cmdRing but if error %cmdRing"><block s="reifyScript"><script><block s="doIfElse"><block s="reportIsA"><block var="spoken"/><l><option>number</option></l></block><script><block s="doRun"><block var="what to do with the number"/><list><block var="spoken"/></list></block></script><script><block s="doRun"><block var="what to do if not a number"/><list><block var="spoken"/></list></block></script></block></script><list><l>spoken</l></list></block><block var="what to do if not a number"/></custom-block></script></block-definition><block-definition s="set language to %'language'" type="command" category="other"><header></header><code></code><inputs><input type="%s"></input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>lang</l></list><l>if (window.speech_recognition) {
 window.speech_recognition.lang = lang;
}</l></block><list><block var="language"/></list></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>if (typeof ecraft2learn === 'object') {




 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.run(function_name, parameters);




 });




 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>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><block-definition s="speak %'message' then %'what to do when finished' with pitch %'pitch' with rate %'rate' with voice %'voice' with volume %'volume' in language %'language code'" type="command" category="sound"><comment x="0" y="0" w="280" collapsed="false">Speaks 'message'. Optionally you can provide a script to run when finished, the pitch (a positive number), rate (a number between .1 and 2), voice (depends upon what voices are accessible from the browser - see 'get voices'), volume (a positive number), and language code (a BCP 47 language tag, e.g. en-US).</comment><header></header><code></code><inputs><input type="%s"></input><input type="%cmdRing"></input><input type="%n"></input><input type="%n"></input><input type="%n"></input><input type="%n"></input><input type="%txt"></input></inputs><script><custom-block s="run eCraft2Learn command %txt with %mult%s"><l>speak</l><list><block var="message"/><block var="pitch"/><block var="rate"/><block var="voice"/><block var="volume"/><block var="language code"/><block var="what to do when finished"/></list></custom-block></script></block-definition><block-definition s="Get voice names" type="reporter" category="sound"><header></header><code></code><inputs></inputs><script><block s="doReport"><custom-block s="call eCraft2Learn reporter %txt with %mult%s"><l>get_voice_names</l><list></list></custom-block></block></script></block-definition><block-definition s="voice name of %'voice number'" type="reporter" category="sound"><header></header><code></code><inputs><input type="%n"></input></inputs><script><block s="doReport"><custom-block s="call eCraft2Learn reporter %txt with %mult%s"><l>get_voice_name</l><list><block var="voice number"/></list></custom-block></block></script></block-definition><block-definition s="Speak %'message' then %'to do when finished speaking'" type="command" category="sound"><header></header><code></code><inputs><input type="%txt"></input><input type="%cmdRing"></input></inputs><script><custom-block s="run eCraft2Learn command %txt with %mult%s"><l>speak</l><list><block var="message"/><l></l><l></l><l></l><l></l><l></l><block var="to do when finished speaking"/></list></custom-block></script></block-definition><block-definition s="Stop speech recognition" type="command" category="sensing"><comment x="0" y="0" w="282" collapsed="true">Stops the current attempt to recognize what is spoken.</comment><header></header><code></code><inputs></inputs><script><custom-block s="run eCraft2Learn command %txt with %mult%s"><l>stop_speech_recognition</l><list></list></custom-block></script></block-definition><block-definition s="Speak %'message'" type="command" category="sound"><comment x="0" y="0" w="331" collapsed="false">Use the browser's default voice to speak the 'message'.</comment><header></header><code></code><inputs><input type="%txt"></input></inputs><script><custom-block s="run eCraft2Learn command %txt with %mult%s"><l>speak</l><list><block var="message"/><l></l><l></l><l></l><l></l><l></l><l></l></list></custom-block></script></block-definition><block-definition s="listen" type="command" category="sensing"><comment x="0" y="0" w="535" collapsed="false">When something is spoken this broadcasts 'heard something' and sets 'last thing spoken' to the text that was spoken.
You will need to create two new variables for this to work: 'last thing spoken' and 'speech recognition error'.</comment><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"><comment x="0" y="0" w="300" collapsed="false">Listens to the microphone for speech. The first script is run with the recognized text unless an error is encountered then the second script is called with text describing the error.</comment><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><block-definition s="Ask %'cloud provider' to say what it sees then %'then receive response' and show the picture %'show photo?'" type="command" category="sensing"><header></header><code></code><inputs><input type="%txt"><options>Google
Microsoft
IBM Watson</options></input><input type="%cmdRing"></input><input type="%s"></input></inputs><script><custom-block s="run eCraft2Learn command %txt with %mult%s"><l>take_picture_and_analyse</l><list><block var="cloud provider"/><block var="show photo?"/><block var="then receive response"/></list></custom-block></script></block-definition><block-definition s="Do %'handle response' with what Google sees and show the photo %'show'" type="command" category="sensing"><comment x="0" y="0" w="258" collapsed="false">Takes a picture and runs script with a list of tags returned by Google. Optionally can show the image.</comment><header></header><code></code><inputs><input type="%cmdRing"></input><input type="%b"></input></inputs><script><custom-block s="Ask %txt to say what it sees then %cmdRing and show the picture %s"><l>Google</l><block s="reifyScript"><script><block s="doRun"><block var="handle response"/><list><custom-block s="Google labels"></custom-block></list></block></script><list><l>response</l></list></block><block var="show"/></custom-block></script></block-definition><block-definition s="Do %'handle response' with what IBM Watson sees and show the photo %'show'" type="command" category="sensing"><comment x="0" y="0" w="319" collapsed="false">Takes a picture and runs script with a list of tags returned by IBM Watson. Optionally can show the image.</comment><header></header><code></code><inputs><input type="%cmdRing"></input><input type="%b"></input></inputs><script><custom-block s="Ask %txt to say what it sees then %cmdRing and show the picture %s"><l>Watson</l><block s="reifyScript"><script><block s="doRun"><block var="handle response"/><list><custom-block s="IBM Watson classes"></custom-block></list></block></script><list><l>response</l></list></block><block var="show"/></custom-block></script></block-definition><block-definition s="Do %'handle response' with what Microsoft sees and show the photo %'show'" type="command" category="sensing"><comment x="0" y="0" w="423" collapsed="false">Takes a picture and runs script with a list of tags returned by Microsoft. Optionally can show the image.</comment><header></header><code></code><inputs><input type="%cmdRing"></input><input type="%b"></input></inputs><script><custom-block s="Ask %txt to say what it sees then %cmdRing and show the picture %s"><l>Microsoft</l><block s="reifyScript"><script><block s="doRun"><block var="handle response"/><list><custom-block s="Microsoft labels"></custom-block></list></block></script><list><l>responses</l></list></block><block var="show"/></custom-block></script></block-definition><block-definition s="IBM Watson image descriptions of new photo" type="reporter" category="sensing"><comment x="0" y="0" w="427" collapsed="false">Takes a picture, asks IBM Watson to classify it, and reports the response when it arrives.</comment><header></header><code></code><inputs></inputs><script><block s="doDeclareVariables"><list><l>response</l></list></block><block s="doSetVar"><l>response</l><block s="reportBoolean"><l><bool>false</bool></l></block></block><custom-block s="Do %cmdRing with what IBM Watson sees and show the photo %b"><block s="reifyScript"><script><block s="doSetVar"><l>response</l><block var="r"/></block></script><list><l>r</l></list></block><block s="reportBoolean"><l><bool>false</bool></l></block></custom-block><block s="doWaitUntil"><block s="reportNot"><block s="reportEquals"><block var="response"/><block s="reportBoolean"><l><bool>false</bool></l></block></block></block></block><block s="doReport"><block var="response"/></block></script></block-definition><block-definition s="Google image descriptions of new photo" type="reporter" category="sensing"><comment x="0" y="0" w="413" collapsed="false">Takes a picture, asks Google to classify it, and reports the response when it arrives.</comment><header></header><code></code><inputs></inputs><script><block s="doDeclareVariables"><list><l>response</l></list></block><block s="doSetVar"><l>response</l><block s="reportBoolean"><l><bool>false</bool></l></block></block><custom-block s="Do %cmdRing with what Google sees and show the photo %b"><block s="reifyScript"><script><block s="doSetVar"><l>response</l><block var="r"/></block></script><list><l>r</l></list></block><block s="reportBoolean"><l><bool>false</bool></l></block></custom-block><block s="doWaitUntil"><block s="reportNot"><block s="reportEquals"><block var="response"/><block s="reportBoolean"><l><bool>false</bool></l></block></block></block></block><block s="doReport"><block var="response"/></block></script></block-definition><block-definition s="Microsoft image descriptions of new photo" type="reporter" category="sensing"><comment x="0" y="0" w="519" collapsed="false">Takes a picture, asks Microsoft to classify it, and reports the response when it arrives.</comment><header></header><code></code><inputs></inputs><script><block s="doDeclareVariables"><list><l>response</l></list></block><block s="doSetVar"><l>response</l><block s="reportBoolean"><l><bool>false</bool></l></block></block><custom-block s="Do %cmdRing with what Microsoft sees and show the photo %b"><block s="reifyScript"><script><block s="doSetVar"><l>response</l><block var="r"/></block></script><list><l>r</l></list></block><block s="reportBoolean"><l><bool>false</bool></l></block></custom-block><block s="doWaitUntil"><block s="reportNot"><block s="reportEquals"><block var="response"/><block s="reportBoolean"><l><bool>false</bool></l></block></block></block></block><block s="doReport"><block var="response"/></block></script></block-definition><block-definition s="Recognize new photo %'cloud provider'" type="reporter" category="sensing"><comment x="0" y="0" w="275" collapsed="false">Takes a photo and ask the cloud provider to recognize it.
Reports the response when it arrives.</comment><header></header><code></code><inputs><input type="%s"><options>Google
Microsoft
IBM Watson</options></input></inputs><script><block s="doDeclareVariables"><list><l>response</l></list></block><block s="doSetVar"><l>response</l><block s="reportBoolean"><l><bool>false</bool></l></block></block><custom-block s="Ask %txt to say what it sees then %cmdRing and show the picture %s"><block var="cloud provider"/><block s="reifyScript"><script><block s="doSetVar"><l>response</l><block var="r"/></block></script><list><l>r</l></list></block><block s="reportBoolean"><l><bool>false</bool></l></block></custom-block><block s="doWaitUntil"><block s="reportNot"><block s="reportEquals"><block var="response"/><block s="reportBoolean"><l><bool>false</bool></l></block></block></block></block><block s="doReport"><block var="response"/></block></script></block-definition><block-definition s="Current image property from %'cloud provider' get %'property name or names'" type="reporter" category="sensing"><comment x="0" y="0" w="344" collapsed="false">Reports a property of the most recent recognition by the AI cloud provider.
Visit tinyurl.com/snap-ai-docs to learn more.</comment><header></header><code></code><inputs><input type="%txt"><options>Google
Microsoft
IBM Watson</options></input><input type="%mult%txt"></input></inputs><script><block s="doReport"><custom-block s="call eCraft2Learn reporter %txt with %mult%s"><l>image_property</l><list><block var="cloud provider"/><block var="property name or names"/></list></custom-block></block></script></block-definition><block-definition s="IBM Watson scores" type="reporter" category="sensing"><comment x="0" y="0" w="390" collapsed="true">Reports the confidence scores for the list reported by 'IBM Watson classes'.</comment><header></header><code></code><inputs></inputs><script><block s="doReport"><custom-block s="Current image property from %txt get %mult%txt"><l>IBM Watson</l><list><l>score</l></list></custom-block></block></script></block-definition><block-definition s="IBM Watson classes" type="reporter" category="sensing"><comment x="0" y="0" w="331" collapsed="false">Reports a list of tags from IBM Watson from the last time it was asked to recognize an image.</comment><header></header><code></code><inputs></inputs><script><block s="doReport"><custom-block s="Current image property from %txt get %mult%txt"><l>IBM Watson</l><list><l>class</l></list></custom-block></block></script></block-definition><block-definition s="Microsoft first caption" type="reporter" category="sensing"><comment x="0" y="0" w="403" collapsed="true">Reports the best caption from the last image recognition that Microsoft did.</comment><header></header><code></code><inputs></inputs><script><block s="doReport"><block s="reportListItem"><l>1</l><custom-block s="Current image property from %txt get %mult%txt"><l>Microsoft</l><list><l>description</l><l>captions</l><l>text</l></list></custom-block></block></block></script></block-definition><block-definition s="Google labels" type="reporter" category="sensing"><comment x="0" y="0" w="324" collapsed="true">Reports the tags from the last image recognition by Google.</comment><header></header><code></code><inputs></inputs><script><block s="doReport"><custom-block s="Current image property from %txt get %mult%txt"><l>Google</l><list><l>labelAnnotations</l><l>description</l></list></custom-block></block></script></block-definition><block-definition s="Google label scores" type="reporter" category="sensing"><comment x="0" y="0" w="297" collapsed="false">Reports the confidence scores of the 'Google labels' 
from the last image recognition by Google.</comment><header></header><code></code><inputs></inputs><script><block s="doReport"><custom-block s="Current image property from %txt get %mult%txt"><l>Google</l><list><l>labelAnnotations</l><l>score</l></list></custom-block></block></script></block-definition><block-definition s="Microsoft labels" type="reporter" category="sensing"><comment x="0" y="0" w="334" collapsed="true">Reports the tags of the last image recognition by Microsoft.</comment><header></header><code></code><inputs></inputs><script><block s="doReport"><custom-block s="Current image property from %txt get %mult%txt"><l>Microsoft</l><list><l>description</l><l>tags</l></list></custom-block></block></script></block-definition><block-definition s="Use camera to make costume" type="command" category="looks"><comment x="0" y="0" w="501" collapsed="true">Takes a picture, adds it as a costume of the current sprite, and switches to showing the new costume.</comment><header></header><code></code><inputs></inputs><script><custom-block s="run eCraft2Learn command %txt with %mult%s"><l>add_photo_as_costume</l><list></list></custom-block></script></block-definition><block-definition s="Show current photo %'cloud provider'" type="command" category="looks"><comment x="0" y="0" w="364" collapsed="false">Adds the photo taken when the AI cloud provider was last asked to reocognize. 
Photo is added as a costume of the current sprite.</comment><header></header><code></code><inputs><input type="%txt"><options>Google
Microsoft
IBM Watson</options></input></inputs><script><custom-block s="run eCraft2Learn command %txt with %mult%s"><l>add_current_photo_as_costume</l><list><block var="cloud provider"/></list></custom-block></script></block-definition><block-definition s="IBM Watson image key" type="reporter" category="other"><header></header><code></code><inputs></inputs><script><block s="doReport"><l>cafd37ff762bdd2f1ddbe674dd8f9eeee3d68111</l></block></script></block-definition><block-definition s="Watson image key" type="reporter" category="other"><header></header><code></code><inputs></inputs><script><block s="doReport"><l>Enter your key here</l></block></script></block-definition><block-definition s="Microsoft image key" type="reporter" category="other"><header></header><code></code><inputs></inputs><script><block s="doReport"><l>Enter your key here</l></block></script></block-definition><block-definition s="Google image key" type="reporter" category="other"><header></header><code></code><inputs></inputs><script><block s="doReport"><l>Enter your key here</l></block></script></block-definition><block-definition s="Microsoft speech key" type="reporter" category="other"><header></header><code></code><inputs></inputs><script><block s="doReport"><l>Enter your key here</l></block></script></block-definition><block-definition s="Get Mary TTS voices" type="reporter" category="sound"><header></header><code></code><inputs></inputs><script><block s="doReport"><custom-block s="call eCraft2Learn reporter %txt with %mult%s"><l>get_mary_tts_voice_names</l><list></list></custom-block></block></script></block-definition><block-definition s="Get Mary TTS voice name %'voice number'" type="reporter" category="sound"><header></header><code></code><inputs><input type="%n"></input></inputs><script><block s="doReport"><custom-block s="call eCraft2Learn reporter %txt with %mult%s"><l>get_mary_tts_voice_name</l><list><block var="voice number"/></list></custom-block></block></script></block-definition></blocks><variables></variables></project>