Train TJBot to Be a Translator in Node-RED

JeanCarl Bisson
2 min readAug 21, 2017

--

Today we’ll train TJBot how to listen, translate, and speak phrases from English to French using the listen, translate, and speak nodes and the Watson Speech to Text, Language Translator, and Text to Speech services.

We’ll use three skills TJBot has been previously trained with during this series and combine them together to be a translator that listens and repeats the phrases translated into French. TJBot can listen to speech and transcribe audio into text using the IBM Watson Speech to Text service, translate the phrases using IBM Watson Language Translator service, and speak using the IBM Watson Text to Speech service.

In the TJBot configuration, enable the microphone and speaker, select French from the speak dropdown menu, and select English from the listen dropdown menu.

Enter the credentials for the three Watson services: Language Translator, Text to Speech, and Speech to Text.

Click on the tab on the left side of the inject node labeled Start Listening. Speak a phrase. The microphone will record the audio, use the Speech to Text service to transcribe into text, translate the text into French, and use Text to Speech to play the audio via the speaker.

Here’s a video of how to train TJBot to translate and speak what was heard.

That’s it for today’s skill. What can you train TJBot to do now that it can translate in near real-time?

Come back tomorrow and we’ll train TJBot to recommend lunch spots.

Correction: Je m’excuse. As you may have noticed, this example didn’t sound right. The underlying TJBot library uses the en-US_MichaelVoice by default. It turns out there is no masculine voice for the French language, and so TJBot speaks the English version of the French translation. Changing the gender of the TJBot to female will have TJBot use the French voice, Renee. Here’s an example:

This post is part of a series of skills you can train TJBot to perform.

--

--

JeanCarl Bisson

I’m an IBM Technical Innovation Lead. I love to build prototypes and then share how I designed and built what I made so others can try it too.