Universal Translator

Speak and be spoken to — translate between thousands of language pairs with voice recognition, using the Raspberry Pi.

Written by Dave Conroy

image

Time Required: 1–2 Hours

Cost: $85–$200

image

DAVE CONROY
is a Boston-based Northeastern University grad who has a true passion for all things tech. @conroydave daveconroy.com

Materials

» Raspberry Pi single-board computer Maker Shed item #MKRPI2, makershed.com

» SD Card, 4GB or more Get a Pi and 8GB card bundled, Maker Shed #MKRPI4 or MKRPI5. Or get more goodies in the Raspberry Pi Essentials Kit, #MSRPIESS, or Raspberry Pi Starter Kit, Maker Shed #MSRPIK or RadioShack #277-196.

» USB headset such as RadioShack #43-256

» Battery pack, 4xAA, with USB socket (optional) for portable operation, RadioShack #270-087

» Wireless USB network adapter (optional) aka wi-fi dongle, for portable operation. Get it in our Pi-Fi Bundle, Maker Shed #MSBUN65; or separately, RadioShack #25-2966.

» USB keyboard Any will do, but check out our Pimoroni accessory kits, Maker Shed #MKPMR06 and MKPMR07.

Tools

» HDMI monitor for interfacing with the Raspberry Pi

» Computer with internet access for establishing free online accounts needed to interact with the Universal Translator

IF YOU’VE EVER TRIED TO COMMUNICATE WITH SOMEONE WHO ONLY SPOKE A FOREIGN LANGUAGE, YOU KNOW IT CAN BE EXTREMELY DIFFICULT — even with the help of modern translation websites. In this project you’ll turn a $39 mini-computer into a feature-rich language translator that supports voice recognition, native speaker playback, and thousands of language pairs. The unbelievable part is that it can all be done on the cheap by leveraging inexpensive hardware, free translation APIs, and some open-source software.

The Universal Translator works by recording a spoken phrase using a headset and the Raspberry Pi mini computer Images. It then converts it into text using Google’s API for speech recognition Images. This text is fed into Microsoft’s translation API Images where it is translated into the desired language and then turned back into speech once again. The Raspberry Pi then plays the translated phrase back to the user through the headset Images.

The Universal Translator is a perfect weekend project that will teach you how to use some very powerful tools to create something immediately useful. Oh, and it’s a blast to play with. Here’s how it’s done:

1. INSTALL FREE SOFTWARE ON THE PI, including MPlayer and FLAC to handle sound files and Libcurl to transfer files.

2. CONFIGURE THE USB HEADSET as the Pi’s audio input and output device.

3. DOWNLOAD AND EXTRACT THE PROJECT CODE: a shell script and 2 Python scripts. It’s free on Github (github.com/dconroy/PiTranslate), and you can use and modify it as you wish.

4. REGISTER ONLINE FOR GOOGLE SPEECH AND MICROSOFT TRANSLATION APIS at cloud.google.com/console and datamarket.azure.com/developer/applications. Then enter the API keys into their respective Python scripts.

5. USE IT! By default, the Translator translates English to Spanish. You can easily change your origin and destination languages in the last line of text-to-translate.py and the script will do the rest. Execute the speech-to-text script:

./stt.sh

Now speak into the headset — “My hovercraft is full of eels.” — and press Ctrl-C when done.

The Pi displays feedback on the command line — Translating ‘my hovercraft is full of eels’. — and then speaks the translation in your headset:

“Mi aerodeslizador está lleno de anguilas.”

Enjoy! Images

Get complete instructions, code, and video on the project page: makezine.com/projects/universal-translator.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.100.219