Friday, February 13, 2015

QtSpeech progress

This week some changes in knotifications/knotifyconfig/kanagram/okular are in the works. The kanagram changes are already on master, the others are in review. Those changes are bringing back the use of text to speech features via the new QtSpeech module. Some have asked what the status of QtSpeech is, so I thought I'd share a bit about it here.

Frederik Gladhorn created the QtTextToSpeech module a while ago as a test to see how feasible it would be to wrap all the platforms Qt is supported on's TTS APIs in one easy to use Qt API. This turned out to be a great idea in my opinion. The predecessor to QtSpeech in KDE applications was Jovie, formerly known as kttsd. While it worked for the most part it required a daemon to be running which spoke with different synthesizers (originally) then was modified to use speech-dispatcher directly instead (when it was renamed to Jovie). QtSpeech on the other hand is a library. If you want to use it, you link to it in your application, create a QTextToSpeech object, and pass any text to speak to it's "say" method. No D-Bus connection required, no daemon required, just a small, light library that wraps the native platform TTS API directly.

As for the status of QtSpeech, I'm afraid it's not quite ready for prime time. It wont likely get added to Qt 5.5 which has feature freeze next Monday. It is however ready to be tested, improved, etc. on each platform. Most of it's API is implemented completely on linux, The basic API (saying text) is implemented on Android, Windows and Mac OS X. Patches are on gerrit to implement the rest of the API (getting available voices, locales, setting the voice) on OS X and will be written soon for Windows also. I plan to spend a bit of time on it each week so it will be ready for release with Qt 5.6 and I hope anyone else interested will join us.

More information about QtSpeech can be found here http://qt-project.org/wiki/QtSpeech. I hope this update has been helpful.

P.S. Here's a work in progress screenshot of the example widget Frederik created which is inside the QtSpeech git repository as it appears on OS X.


Edit: The wiki has been moved apparently. It's now found here: https://wiki.qt.io/index.php?title=QtSpeech

3 comments:

Unknown said...

I created patch for kdepim* too :)

I hope that we will able to release it in 5.6, but I don't know what is missing.

Jeremy Whiting said...

Yeah, I saw that. That's good. I hope QtSpeech will do all it was designed to do. The items that are missing are listed on the wiki I linked to in the blog post. Namely:
Implementation on OS X and Windows (and Android probably).
Improving the implementation on linux (exposing all voices, not just the ones from speech-dispatcher's default synthesizer).

Then just polish and make sure it's clean enough for inclusion in Qt itself I believe.
Note that when I say implementation I mean of the API such as listing the voices, tweaking them, etc. Basic functionality of speaking, stopping, etc. already works on linux, windows, osx and android iirc.

Unknown said...

Very helpful, I'm looking forward to Qt 5.6. I have a cross platform application that needs TTS.