Armed only with a bucket full of enthusiasm, a wiki full of miss-information and a 2 digit IQ, the good Captain seeks not only to understand the modern world, but also fix one or two bits of kit along the way.

Category

Wednesday, 17 October 2012

Giving Your Computer A Voice

I've found it very helpful in a few cases to add audible alarms to
monitoring functions. For example, if you work in a network support
environment and a server goes down, you need to know about it straight away.......preferably before your phone goes into melt-down!

By using text-to-speech, you can monitor several aspects of your working environment without having to continually check display screens.

I
recommend eSpeak, which is a compact, cross-platform, open source software, speech
synthesiser. Although the sound is not as natural as that produced by a system based upon human recordings, its very small size makes it a good choice for small devices, the Raspberry Pi and for applications producing announcements.

Install on Linux

You will probably find eSpeak listed in your distributions repository. So on a Debian based system (e.g. Ubuntu) you can install via Synaptic package manager, or via a terminal:-sudo apt-get install espeak

Check It Out!

Note for Windows users: The examples that follow using Linux also apply to Windows, except that the Windows version allows you to run a gui app or a command line version.For the command line version, at the command prompt type:-cd C:\Program Files\eSpeak\command_line

Now you can probably follow the Linux examples that follow.

Once installed, you can test it on a Linux system by typing something in a
terminal:-espeak hello

...or for more than single words...espeak "hello steve"

You can change the default voice by using the voice switch, so:-espeak -ven+f4 "the time is 2pm"

...should give you an English female voice, where the command option (-ven+f4) means: voice English female, the 4th female voice. There are 5 voice presets (1 - 5).

So for a male voice you might use:-espeak -ven+m2 "I need a beer"

Having
different voices can be useful. For example, you could use a female
voice when a server goes down, and a male voice when a new job request
arrives on you Help Desk. But with the monitoring system that we use, I've
created 10 voices which are simply selected at random (its less monotonous that way).

You can also "speak" text files like this...espeak -ven+f4 myTextFile

...but espeak is probably not the best choice for a book reader.

Using eSpeak With Gambas
It should be really easy to include eSpeak in your applications using a wide range of programming languages.

Here are some examples using Gambas, which is a Basic dialect for Linux, but you could do something similar in Visual Basic on a Windows system:-