espeak works fine but voice is creepy (especially in french !). This post explains how to use the google voice api to get a wonderful female clear voice.

first, create It contains a function “say()” which call with parameter $* (parameter of your shell)

say() { local IFS=+;/usr/bin/mplayer -ao alsa -really-quiet -noconsolecontrols “$*” 2>/dev/null;}
say $*

Notice that this url will speak french. If you want to speak english, just change “tl=fr” by “tl=en” (german: tl=de, spanish: tl=es, etc.)

Change attribute of your sh file to allow execution and try it. Notice that this URL only accepts sentence less than 100 letters.

chmod u+x ./
./ “Bonjour. Je veux manger du fromage.”

Now, you can use it in your C file.

void speak(char *sLine)
    char sCmd[255];
    sprintf(sCmd,”./ %s”,sLine);

    // if (TRACE) printf(“[i] say : %s”,sLine);


To read a whole text (length > 100 letters)

char sToBeRead[100];
f = fopen(fileName,”r”);
if (f != NULL)
    // read all text
     while (!feof(f))
        if (fgets(sToBeRead, 100, f)!=NULL)
   return 1;
return 0;

At this end of this post, your wife/girlfriend should not like the new voice of your magic mirror… 😉