Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

In Windows I can do these steps:

1. Open Notepad
2. Copy and Paste 

CreateObject("SAPI.SpVoice").Speak"Hello."

3. Save it as xyz.vbs
4. Run it/Open it

It will then speak "Hello". Is there something like this in Ubuntu?

share|improve this question

marked as duplicate by Avinash Raj, Seth, TrailRider, BuZZ-dEE, Olli Feb 12 at 10:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
    
yes you can, see the first answer in the above link. –  Avinash Raj Feb 11 at 9:41

2 Answers 2

up vote 5 down vote accepted

Install the espeak Install espeak package. Then run in a terminal

espeak -v en "Hello"

To change the voice, please refer to the manpage. An excerpt from man espeak:

   --voices[=<language code>]
          Lists  the available voices. If =<language code> is present then only
          those voices which are suitable for that language are listed.

   -v <voice name>
          Use voice file of this name from espeak-data/voices
share|improve this answer
    
Can I change the voice ? –  Unbound Feb 11 at 9:24
    
@AvinashRaj Where is that requirement given in the question? And for this example he provided in Windows you'll need Visual Basic scripting and speech synthesis components installed. –  gertvdijk Feb 11 at 9:28
    
Is there any option for female vooice? –  Unbound Feb 11 at 9:38

There is a link which will give detailed text to speech command line tools.

http://elinux.org/RPi_Text_to_Speech_%28Speech_Synthesis%29

The first speech package I tried was Festival. It worked fine and produces a voice like a rough sounding robot.

Festival Text to Speech

Install Festival with:

sudo apt-get install festival

Try out Festival with:

echo “Just what do you think you're doing, Dave?” | festival --tts

Espeak Text to Speech Espeak is a more modern speech synthesis package than Festival. It sounds clearer but does wail a little. If you are making an alien or a RPi witch then it’s the one for you! Seriously it is a good allrounder with great customisation options.

Install Espeak with:

sudo apt-get install espeak 

Test Espeak with: English female voice, emphasis on capitals (-k), speaking slowly (-s) using direct text:-

espeak -ven+f3 -k5 -s150 "I've just picked up a fault in the AE35 unit"
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.