I am glad to announce new small project that got first release – QtSpeech.
This is library providing Qt-like interface to system TTS (text-to-speech) engines to allow your application to say “Hello World!”.
Current API is very simple.
First you need to include . Then if your application just needed to say something synchronously (execution will wait in the point until speech is finished) you can use such code:
#include <QtSpeech>
...
QtSpeech voice;
voice.say("Hello World!");
If you would like to do this in asynchronous way (so your application is not blocked meanwhile) just use tell() call:
QtSpeech * voice = new QtSpeech(this);
voice->tell("Hello asynchronous world!");
If you need to invoke a slot at the end, use:
voice->tell("Hello!", this, SLOT(onSpeechFinished()));
Also you have possibility to get list of voices and choose voice from available in your system:
QtSpeech::VoiceNames vs = QtSpeech::names()
Current implementation support Windows using SAPI and Mac. I have plans to extend API to include more functionality but will try to choose what is common on all platforms.
Link to repository in Gitorius: http://gitorious.org/qt-speech
UPDATE: Unix/Linux got implementation too! Based on Festival, so only English at the moment, but it is a great start to have TTS working in Qt applications too in Linux systems!