How to make your computer talk to you?

Nowadays, it may be not very surprising that computers can talk ;) How to make our computer talk to us using C++? How to start without any deep knowledge about Text To Speech Synthesis (TTS), Hidden Markov Modelling (HMM) or even without any recording? This article is a short tutorial for you. You will get your first synthesized speech sooner than you think.


  1. eSpeak TTS engine
  2. C++ skills and gcc compiler


  1. Include eSpeak API by adding “speak_lib.h” header
  2. Configure eSpeak to synthesize sentence in specified language. The most important functions from eSpeak API.
    1. espeak_Initialize
    2. espeak_SetVoiceByName
    3. espeak_SetSynthCallback
  3. Run synthesis by calling espeak_Synth and to wait for the result espeak_Synchronize


Only the espeak_Initialize is obligatory for us – we should decide if our synthesized sample will be stored as WAVE recording or played loudly. Furthermore we decided about events generated during the synthesis. It is possible to receive signals right after single phoneme, word or sentence have been synthesized in our own callback. Such callback should be registered using espeak_SetSynthCallback. Finally we decided about the voice using espeak_SetVoiceByName function. Obviously, eSpeak API provides us much more capabilities.

To get working example of such application please follow the link: eSpeak sample If you have any questions please feel free to ask me :)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s