Friday, 9 June 2017

Program Computers to Talk - Coding with Speech Synthesis for Kids

Home voice assistants and toys that use voice interaction are everywhere at the moment. How can kids code their own apps and programs that use speech synthesis?

In our house we make daily use of Amazon's Alexa Echo and Dot and Google Home. There are also lots of toys that use voice interaction to communication with kids.

It's great for kids to use the latest technology (with due consideration given to privacy and security issues) but we think it's even better for kids to have a go at creating with those technologies. In this article we'll have a look at how children can code using speech synthesis - getting computers to talk to them.

What is Speech Synthesis?

Speech synthesis is computer generated speech, it turns typed text into spoken words. Modern speech synthesis uses samples of human speech and then combines sounds to generate increasingly natural-sounding artificial voices. 

In this post we're just going to look at ways that children can code using speech synthesis - turning text into speech. 

This can be used to:
  • Create an exercise assistant that talks kids through a custom exercise routine
  • Create a spelling test app that tests children on their spellings by saying words
  • Create an interactive assistant that can give information
We'll save voice recognition (understanding spoken speech) and voice-based services (using artificial intelligence tools to create responses) for future posts. There's a lot you can do with just speech synthesis and it's approachable for young children so it's a great place to start.

We'll start with the simplest options and move on to move advanced approaches. 

You might also like:

 Recording Your Voice

Actually, even before speech synthesis, comes being able to record your voice and play it back. This is something young children absolutely love. 

We use simple voice recorder boxes for projects at events - children love recording their voice and then triggering its playback. This allows you to create interactive projects that use old-style precanned voice recordings.

Scratch Jr (for Android, iPad, Kindle Fire and ChromeOS) allows little kids to record their voices and play their recordings back using code blocks. This is a lot of fun!

Voice recording and playback is also a popular activity in Scratch. Kids can record their voices and then use code to play it back using Scratch 2.0 online. When Elbrie's youngest son was learning phonics we got his older brother to record letter sounds and made a Scratch phonics app using MaKey MaKey and play dough


Scratch itself doesn't support speech synthesis yet, but there's a Scratch text to speech extension that does. You can use the extension online at (a site that hosts unsupported add-ons to Scratch.)

This extension adds a 'speak' block to Scratch. Children who are used to using Scratch will get the idea quickly.


OhBot is a programmable robot head that does a lot more that speech synthesis. But it does do speech synthesis rather nicely with synchronised lip movements. 

OhBot has a block-based programming environment that allows kids to easily generate speech. It uses the Microsoft Windows text to speech features. 

We use OhBot as an interactive assistant at events. It's also a big hit at kids parties for programming jokes! OhBot is great for getting kids thinking about how people interact with robots.

Here's a video of a project we made using OhBot:

And the code:

Pocket Code

Pocket Code is a drag and drop programming environment for Android devices. I keep Pocket Code installed on my phone for when my kids want to do some unplanned coding when we're away from their other devices! Yes, that happens. 

Pocket Code is great for creating apps that work well on touchscreen devices.

The Everything Machine

The Everything Machine is an awesome app from Tinybop. The Everything machine allows you to turn an iOS device into all sorts of amazing gadgets that make use of the inputs and output son the device. 

One of the output options is the 'Type Talker' which turns text into spoken speech. It has options for changing the speed and pitch of the speech which is lots of fun. 

Here's an example project from Tinybop:

Pencil Code

Pencil Code is a block-based online coding environment that's a bit more advanced than Scratch.

It supports speech synthesis so you can create apps like this spelling test:

Here's the code:

Talking Web Pages with Trinket

Trinket is an online coding editor that you use in a browser. It supports the development of interactive web pages with HTML, CSS and JavaScript. This only works in supported web browsers.


Minecraft 1.12 (just released) has support for a text-to-speech voice narrator.

If you combine this feature with Command Blocks (or the new functions) then you can code with voice in Minecraft which is pretty neat.

Swift Playgrounds 

Swift Playgrounds is an iOS app that teaches Apple's new programming language. Swift Playgrounds can be used with Siri Text to Speech to create apps that talk.

More Options

These options are more advanced and we'll look at them in more detail in future, just a quick mention for now. Note that some APIs have age restrictions. 
  • TJBot from IBM is a fun Raspberry-Pi based robot that can be used with the Watson conversation API to create a talking robot
  • The AIY Projects Voice Kit is another Raspberry Pi based kit and was recently included as a free gift with the MagPi magazine. It turns a Raspberry Pi using Google Assistant. 
  • You can program using the Amazon Alexa API and even create new Alexa skills. This works on a Raspberry Pi too. 


Voice recording playback and speech synthesis are great ways to get kids having fun with coding and creating useful projects too. 

Voice-based toys and gadgets are becoming more and more popular and it's important for kids to understand the tech around them.

There are loads of really cool options for kids with different experience levels to try creating apps and projects that talk to their users.

More from Tech Age Kids:


Post a Comment