If you’ve ever tried to communicate with someone who only spoke a foreign language, you know that it can be extremely difficult — even with the help of modern translation websites. This project will show you how to turn a $35 mini-computer into a feature-rich language translator that not only supports voice recognition and native speaker playback, but is also capable of translating between 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.
Even if you’re not interested in building this exact translation tool, there are still many parts of this project that might be interesting to you such as Google’s speech recognition API, Microsoft’s translation API, and text to speech. All of the source code for this project is publicly available on Github, and you’re welcome to use and modify it as you wish. The Universal Translator makes a perfect weekend project because it incorporates a wide range of technology and tools to create something immediately useful. Oh, and it’s a blast to play with.
Pick up all the parts at your local RadioShack, follow the instructions below, and you’ll have your own babel fish in no time.
Dave, does it translate “stupid”? I have a hard time understanding that and haven’t been successful in finding a translation solution. :-) Seriously though, this is pretty cool!
Peter, that is scheduled for version 2.0!
Stupid like Vogon sir?
Vogon poetry
translated much wow!
my neigbour just got a nice year old Mercedes-Benz just by some part-time working online with a cheap laptop. Learn More earndollars.com
Well done sir.
Is there a way to make a physical button to execute the ./stt.sh ? I am planning to use this in an exhibition and it would be amazing if people yould just press a button istead of typing command lines. I am sure it is not hard to make but i have no idea how. The kind of button i´d like to use is a usb buzzer like that. bit.ly/1wiuzQn Could you help me?
Using GPIO would be the way. Check this project, should give you a way to start: https://learn.adafruit.com/playing-sounds-and-using-buttons-with-raspberry-pi/install-audio
You can use GPIO, but for ease of hooking things like this up, I like to use a teensy embedded in the button/button panel, that can then be hooked via USB. Teensy can do USB serial, (and your pi program can read that) or you can actually have it emulate a keyboard.
Awesome tutorial. I followed it up and I got almost everything to work. I don’t have USB Microphone, I have the Apple Headphones (with Mic) and I also ave just mic. I couldn’t seem to be able to test my mic and at the end I got this error: http://prntscr.com/4mm63z
I took a screenshot to ease the explaining pain.
The RPi does not support mic input on the headphone jack. Sorry.
A “stupid” translator? I’ll take one!
What a fantastic project. I completed it in such a small amount of time, and yet the payoff is so huge. I am going to redo it with my young kids and get them introduced to the RasPi, APIs, and the framework of modular programming. Great stuff, Dave!
A note on power. I did a lot of research on power requirements for small computer boards while writing Hacking and Penetration Testing with Low Power Devices (Syngress, 2014). The more energy efficient BeagleBone Black with a wireless adapter will only run about 7.5 hours off of AA batteries. The Pi is not nearly as efficient and will likely get your 4-5 hours off of the AA batteries on a good day. So if you want to make the translator portable be prepared to spend some cash on the batteries. Incidentally, moving up to C sells with better than triple the run time.
my headphones won’t show up and I rebooted. Ideas?
P.S. they work fine on my desktop
I used a “translate Api” and it is translating the feed back too. It won’t here my speech so I think I need to use the speech Api but I could not find it? It wasn’t listed. Can you help me.
you need to join the Chromium-dev Google Group the link is in the page
I keep getting an error saying cannot find an active azure marketplace translator subscription associated with the requested credentials: ID=3627.V2_Json.Translate.556BCC47
Dave, I have tried your code, am getting follwing error while trying to execute speech to text.. please advise on this..
was there an answer to this? i’ve come across the same problem
Copy & pasting Speech API key solved my problem..
I’m having that same problem too.
thank you so much sir for providing such useful information and project which we can use in our day to day life.
our universal translator is running successfully ,but sometimes due to some ssl certificate issue it does not operate but after rebooting it operates succesfully.
Hi!!! I’ve got an error:
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:79 InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may certain SSL connections to fail. For more information, see http://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Traceback (most recent call last):
File “PiTranslate.py”, line 64, in
headers={‘Authorization’:’Bearer’+oauth_junk[‘access_token’]}
KeyError:’access_token’
And I don’t know why can you help me??
Me to. Someone please help us!!
I’m having trouble linking the APIs to the Pi I
downloaded the code and gave it the necessary data. I used 3 Google accounts
and all 3 didn’t work
Hi this system is very success on my RPi2 but now i have some question
“You can easily change your origin and destination languages in the last line of text-to-translate.py ”
So I come from Taiwan ,I want to change to Chinese
” os.system(“python PiTranslate.py -o en -d es -t ‘” + final_result + “‘”) ”
Is that en and es change to ch ch?
my pi spat out an error message along the lines of InsecurePlatformWarning
file “PiTranslate.py” line 47 in
KeyError: ‘access_token’
I am new to Raspberry Pi, so I have no idea what it means. Has anyone else had the same problem?
Me to someone please help!
I keep trying to test out the record of my headset but it shows
arecord; main;682; audio open error; No such file or directory
How to fix?
can i use
9 mm Headset Driver Units
if yes pls sent the ALSA configuration file in harishankar998997@gmail.com
Joining the chromium dev group does not give access to speech api now.
Any other alternative?
dave i cannot get my usb sound card as primary using mod alsa_base.cong when opened just a blank file. I read somewhere else that raspbian jesse does not use this file Could you please provide some help.
Did everything as stated; I get an error that says:
“arecord: pcm_read:2031: read error: Interrupted system call”
Any idea what could fix that?
(Im using Rpi 3)
i plugged my usb logitech headset in,it does not detect it at all,help please!I tried to reboot aswell.
ConfigureACCEPT
Privacy Overview
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.