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.

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

2 Answers 2

up vote 5 down vote accepted
  • espeak

    espeak is a multi-lingual software speech synthesizer.

    sudo apt-get install espeak
    espeak "hello"
    
  • spd-say

    spd-say sends text-to-speech output request to speech-dispatcher

    sudo apt-get install speech-dispatcher
    spd-say "hello"
    
  • say

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

    sudo apt-get install gnustep-gui-runtime
    say "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.