Skip to content
Ceyhun ÖZGÜN edited this page Jul 22, 2018 · 8 revisions

AWS AI Scratch Extension Wiki

AWS AI Scratch Extension is a Scratch Extension that allows users to try Amazon Web Services AI Services like Amazon Polly and Amazon Translate for converting text to speech and translating text between different languages.

Try extension with sample project that translates from English to Spanish here.

Try extension here.

Find code on GitHub repo

For more information on Scratch extensions, see here.

Blocks

Blocks for the extension

Generic Blocks

init AWS [region]

Initialize AWS JavaScript SDK for connecting to the specified AWS region. This block asks AWS Access Key Id and Secret Access Key with JavaScript prompt method and remembers if it is started again without closing the browser. For more information on getting access keys, see here. Please note that you should keep your AWS secret keys private, and I recommend you to apply 'Least Privileges' practice for these credentials by adding AmazonPollyReadOnlyAccess and TranslateReadOnly policies only. For more information, see IAM Best Practices.

Amazon Polly Blocks

choose language [language]

Selects the language that will be used by Amazon Polly. Currently supported languages are English, Spanish, French, German, Italian and Turkish.

say [text]

Converts text to speech using Amazon Polly synthesizeSpeech method in selected language and plays the audio file.

Amazon Translate Blocks

choose source language [language]

Selects the language that will be used as source language by Amazon Translate. Currently supported languages are: Currently supported languages are English, Spanish, French, German, Italian and Turkish. Please note that Amazon Translate supports the translation from English to other languages and from other languages to English only for now.

choose target language [language]

Selects the language that will be used as the target language by Amazon Translate.

translate [text]

Translates the text from selected source language to selected target language using Amazon Translate translateText method and sets translatedText variable.

translatedText

Contains the translation result.