Can I use Google Translate to make my Raspberry Pi speak in different languages on demand?

ChrisPrime

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.

Circuit Static

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.

  1. In a terminal window type the following (each on a separate line)

sudo apt-get install alsa-utils

sudo apt-get install mplayer

  1. Then lets look at the modules by typing this in a terminal

sudo nano /etc/modules

  1. After typing the above command check the file that opens to see if it shows the following:

snd_bcm2835

  1. if it does exit. If it DOES NOT add it.

  2. Then add a line to the mlayer configuration by typing this in a terminal:

sudo nano /etc/mplayer/mplayer.conf

  1. Add the following. If you aren't sure where to put it, the bottom works fine

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


Then for the test do the following

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 $*
  • Helpful tip, be sure to remember to change the permissions to read from the file chmod u+x speech.sh

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I use the google voice api on my raspberry pi running debian and chromium

From Dev

How can I use the google voice api on my raspberry pi running debian and chromium

From Dev

Can I use Ubuntu One on the Raspberry Pi?

From Dev

How can I use the Disqus comments in my three-language site in all three languages different?

From Dev

Can I make my PC backup and then sleep on demand with WHS?

From Dev

Can I use .NET SIMD on Raspberry Pi 4?

From Dev

Can I use .NET SIMD on Raspberry Pi 4?

From Dev

Why can't I use python-mosquitto on the Raspberry Pi?

From Dev

How can I make Prolog speak?

From Dev

Can you make a linux system halt and boot my Raspberry-pi at certain times?

From Dev

How to make HashMap of Google Translate supported languages in JAVA?

From Dev

Can I run matlab on raspberry pi?

From Dev

Raspberry Pi What can I do with it?

From Dev

Can I run mythbackend on Raspberry Pi?

From Dev

How can I compile scanbd on Raspberry Pi?

From Dev

Can I run a LAMP server with a webmin interface on my raspberry pi on raspbian?

From Dev

I can't access the internet through my raspberry pi when connected through ssh

From Dev

How can I run a second user session from windows on my local screen (with Raspberry Pi)?

From Dev

How can I make TextToSpeech to speak a text with max volume and restore original volume after speak end?

From Dev

Can I use Nearby google API on raspberry running on android things?

From Dev

Can I use the USB port of the raspberry pi (model B+) for serial communication (RS232)

From Dev

Can I use AUX port in Raspberry Pi 3 (Model B) to plug a microphone to get audio signals in?

From Dev

How can I use SFTP to transfer a directory to my local PC, but make the transfered directory have a different name on my local PC?

From Dev

How to make Raspberry Pi use an external USB sound card as a default

From Dev

How to use my computer's internet connection in Raspberry Pi?

From Dev

How do I make Raspberry Pi 3 discoverable for iOS and CoreBluetooth?

From Dev

I'm trying to use SSHFS to transfer files via SSH to my Raspberry Pi web server, specifically using the GUI

From Dev

How can I make my function accept different types of input?

From Dev

Angular-translate: translate different portions of the page with different languages

Related Related

  1. 1

    How can I use the google voice api on my raspberry pi running debian and chromium

  2. 2

    How can I use the google voice api on my raspberry pi running debian and chromium

  3. 3

    Can I use Ubuntu One on the Raspberry Pi?

  4. 4

    How can I use the Disqus comments in my three-language site in all three languages different?

  5. 5

    Can I make my PC backup and then sleep on demand with WHS?

  6. 6

    Can I use .NET SIMD on Raspberry Pi 4?

  7. 7

    Can I use .NET SIMD on Raspberry Pi 4?

  8. 8

    Why can't I use python-mosquitto on the Raspberry Pi?

  9. 9

    How can I make Prolog speak?

  10. 10

    Can you make a linux system halt and boot my Raspberry-pi at certain times?

  11. 11

    How to make HashMap of Google Translate supported languages in JAVA?

  12. 12

    Can I run matlab on raspberry pi?

  13. 13

    Raspberry Pi What can I do with it?

  14. 14

    Can I run mythbackend on Raspberry Pi?

  15. 15

    How can I compile scanbd on Raspberry Pi?

  16. 16

    Can I run a LAMP server with a webmin interface on my raspberry pi on raspbian?

  17. 17

    I can't access the internet through my raspberry pi when connected through ssh

  18. 18

    How can I run a second user session from windows on my local screen (with Raspberry Pi)?

  19. 19

    How can I make TextToSpeech to speak a text with max volume and restore original volume after speak end?

  20. 20

    Can I use Nearby google API on raspberry running on android things?

  21. 21

    Can I use the USB port of the raspberry pi (model B+) for serial communication (RS232)

  22. 22

    Can I use AUX port in Raspberry Pi 3 (Model B) to plug a microphone to get audio signals in?

  23. 23

    How can I use SFTP to transfer a directory to my local PC, but make the transfered directory have a different name on my local PC?

  24. 24

    How to make Raspberry Pi use an external USB sound card as a default

  25. 25

    How to use my computer's internet connection in Raspberry Pi?

  26. 26

    How do I make Raspberry Pi 3 discoverable for iOS and CoreBluetooth?

  27. 27

    I'm trying to use SSHFS to transfer files via SSH to my Raspberry Pi web server, specifically using the GUI

  28. 28

    How can I make my function accept different types of input?

  29. 29

    Angular-translate: translate different portions of the page with different languages

HotTag

Archive