I have a Raspberry Pi B+ running the latest Raspbian headless, and have forced output to my 3.5mm audio jack so I can connect speakers and have it "speak" on demand (remotely via SSH would be fantastic).
Google translate has a service call that will read text to you in many languages. Anyone have any idea how I could use this to make my Raspberry Pi multilingual on demand?
Even just how to make Google Translate speak some given words in English from a command line would be fantastic. Preferably using a bash script.
I found some information that I think will do what you are looking for. I have tried and had success with the following here. Please try it and see what you think.
If you want your Raspberry Pi to be able to speak to you, in multiple languages, do the following.
sudo apt-get install alsa-utils
sudo apt-get install mplayer
sudo nano /etc/modules
snd_bcm2835
if it does exit. If it DOES NOT add it.
Then add a line to the mlayer configuration by typing this in a terminal:
sudo nano /etc/mplayer/mplayer.conf
nolirc=yes
*Be sure to save your changes. It should be CTRL+X to exit and will prompt you to save your changes in nano
nano speech.sh
Then put the following in a new file called speech.sh and save it.
#!/bin/bash
say() { local IFS=+;/usr/bin/mplayer -ao alsa -really-quiet -noconsolecontrols "http://translate.google.com/translate_tts?tl=en&q=$*"; }
say $*
T7. hen type the following as an example to hear audio on your pi.
./speech.sh Look Dave I can see youre really upset about this
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments