Ubuntu includes a built-in speech synthesizer called espeak. It’s there to work in partnership with the Orca screen reader, which provides support for those who are partially-sighted, but it can also be called from the command-line, as follows:
open terminal: Application ---> Accessories ---> Terminal and type
As you’ll be able to tell it’s not the most sophisticated speech synthesizer in the world (it has a feel of Speak & Spell about it), but it can be fun to play around with. By simply typing espeak, and then hitting Enter , whatever you type after this will be spoken. To quit, type Ctrl + d .