Skip to main content

Activity: Writing a translation program in Scratch

Scratch 3 the gift that keeps on giving; including the new extensions are Text to Speech and Translate; Text to speech - does as the name suggests, turns typed in phrases into speech via Amazon Web Services. Translate using Google (and I assume Google Translate?) to translate text between different languages.



As an experiment, I wanted to play with clapping my hands, have Scratch the Cat ask me to enter a phrase and then convert that into French, German and Spanish with different voices. The resulting code is shown below.


It is all started by a loud noise like a hand clap. The two extensions have been added to the blocks and are ready to go. The voice is initially set to Alto and the text-speech block has had the phrase "Please enter a phrase" typed in and says this. The ask block has the same question permanently set and the answer produced gets feed into the translations. 

The remaining blocks do essentially the same thing
- change the voice;
- take the phrase typed in (via answer) and convert to the language of choice;
- wait a second.


It is great fun, I am not sure all the languages work but what is there is cool to play with. In an ideal world instead of typing the phrase it would be great to just say the phrase...maybe in the future. 

The code is available at https://scratch.mit.edu/projects/282312832/.

Please feel free to add comments below and share how you have used it.



All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon

Comments

Popular posts from this blog

Problem Solving Open educational Resource

  Another new Open Education Resource (OER) has been made available by the School of Science and Technology, University of Northampton. Problem-Solving Author: Dr Scott Turner http://find.jorum.ac.uk/resources/19001 Details These mini lectures are intended for undergraduate computing students, for providing simple steps in problem solving before the students learn a programming language. Problem-Solving and Programming is a common first year undergraduate module on the BSc Computing Programme at the University of Northampton. This material was taken from the problem solving part of the module and provides an introduction to five topics in problem-solving. The resource can be found at:  http://find.jorum.ac.uk/resources/19001 After one week on JORUM  93 downloads  and  12 views  of the OER.

Problem-solving or computational Thinking

Confession time, this has been a research interest for me, along with a number of colleagues, since around 2005. It started with undergraduate students - investigating teaching and developing problem solving skills as a first step in developing programming skills through the use of LEGO-based robots and graphics based programming for undergraduate students. The main vehicle then for developing the problem-solving skills was the LEGO RCX Mindstorms robotics kits and series of gradually more challenging robot-based tasks. Lawhead et al (2003) stated that robots “…provide entry level programming students with a physical model to visually demonstrate concepts” and “the most important benefit of using robots in teaching introductory courses is the focus provided on learning language independent, persistent truths about programming and programming techniques. Robots readily illustrate the idea of computation as interaction”. Synergies can be made with our wo...

Primary School with Computing Problem

A member of the School of Science and Technology helped a local primary school look at ways they could add some programming into some of their ICT lessons. The Greenfoot software ( http://www.greenfoot.org/overview ) and tutorials ( http://www.greenfoot.org/doc ) were used to demonstrate some possible ways this could be done. This type of activity is similar various people are trying around the country to persuade children that programming is fun and not as hard as some people may tell them (see  Coding for kids is as easy as Pi   for another example) This Greenfoot work forms part of the on-going out-reach activities the School of Science and Technology, University of Northampton is actively working in partnerships with schools. Other examples include: Junkbots Outreach during Science and Engineering Week 2012 Girls into Engineering  summary BeSwitched On - Taster Day for computing Dancing robots For more details on any of these please contact Dr Scott ...