I found some information that I think will do what you are looking for. I tried and succeeded in the following. Try it and see what you think.
If you want your raspberry Pi to be able to speak several languages, follow these steps.
- In the terminal window, enter the following (each on a separate line)
sudo apt-get install alsa-utils
sudo apt-get install mplayer
- Then consider the modules by typing this in the terminal
sudo nano / etc / modules
- After entering the specified command, check the file that opens to see if it shows the following:
snd_bcm2835
if it shuts down. If he does NOT add it.
Then add the line to the mlayer configuration by typing it in the terminal:
sudo nano / etc / mplayer / mplayer.conf
- Add the following. If you are not sure where to put it, the lower part works fine
nolirc = yes
* Be sure to save the changes. It must be CTRL + X to exit and prompts you to save the changes to nano
Then for the test do the following
nano speech.sh
Then add the following to 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 $*
- Useful advice, be sure to remember the permission changes for reading from the file chmod u + x speech.sh
T7 buy as an example to hear the sound on your pi.
./speech.sh Look Dave, I see that you are really upset about it
source share