Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to get speech output from entered text by using command-line?

Also facility to change speech rate, pitch, volume etc using simple command.

share|improve this question
    
Possible duplicate of How can I install and use text-to-speech software? – Organic Addict Dec 5 '15 at 20:25
up vote 30 down vote accepted

In order of popularity descendant:

  • say converts text to audible speech using the GNUstep speech engine.

    sudo apt-get install gnustep-gui-runtime
    say "hello"
    
  • festival General multi-lingual speech synthesis system.

    sudo apt-get install festival
    echo "hello" | festival --tts
    
  • spd-say sends text-to-speech output request to speech-dispatcher

    sudo apt-get install speech-dispatcher
    spd-say "hello"
    
  • espeak is a multi-lingual software speech synthesizer.

    sudo apt-get install espeak
    espeak "hello"
    
share|improve this answer

From man spd-say:

NAME
       spd-say - send text-to-speech output request to speech-dispatcher

SYNOPSIS
       spd-say [options] "some text"

DESCRIPTION
       spd-say  sends text-to-speech output request to speech-dispatcher process which handles it and ideally outputs the result
       to the audio system.

OPTIONS
       -r, --rate
              Set the rate of the speech (between -100 and +100, default: 0)

       -p, --pitch
              Set the pitch of the speech (between -100 and +100, default: 0)

       -i, --volume
              Set the volume (intensity) of the speech (between -100 and +100, default: 0)

Hence you can get text-to-speech by following command:

spd-say "<type text>"

Ex:

spd-say "Welcome to Ubuntu Linux"

You can also set speech rate, pitch, volume etc. see man-page.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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