Train TJBot to Speak in Node-RED
Today we’ll train TJBot to speak using the speaker and the Watson Text to Speech service.
Before we begin, let’s talk a little bit more about the hardware that makes this happen. I’ve attached a USB speaker using one of the four USB ports on the Raspberry Pi.
You can also connect an audio cable (from a speaker or headphones), through a USB audio adapter.
Your mileage may vary if you choose to use the audio jack on the Raspberry Pi. Due to a hardware conflict, the LED and audio jack may not work together. This might be a problem if you want to have the TJBot shine the LED and speak an utterance.
TJBot can speak a handful of languages with the help of the language models available from IBM Watson’s Text to Speech service.
Create a Watson Text to Speech service and copy the credentials into the Text to Speech section of the TJBot node configuration.
Here’s where it can get confusing. The Speaker Device ID is a cryptic code to instruct what hardware device the underlying audio library should use to play the audio from IBM Watson.
If you use the USB device (either the USB speaker or a USB audio adapter), SSH into the Raspberry Pi and run the command aplay -l. Look for the card labeled USB Audio and note the card number, in this example card #1, and device number, in this example device #0.
Change the Speaker Device ID to be of the format plughw:<card #>,<device #>.
Here’s a video of how to train TJBot to speak with the speak node.
That’s it for today’s skill. What can you train TJBot to do now that it can speak?
Come back tomorrow and we’ll talk about using the camera to take a picture and classify objects and colors.
This post is part of a series of skills you can train TJBot to perform.