GNOME Bugzilla – Bug 381322
Would be nice to have a GNOME Speech driver for eSpeak.
Last modified: 2007-02-11 14:48:26 UTC
Here's a placeholder for implementing an eSpeak driver for GNOME Speech.
Created attachment 77492 [details] [review] Patch of adding in the basic infrastructure for the eSpeak driver.
Created attachment 77493 [details] Sample program from the eSpeak author to show how to turn text to a speech .wav file.
A lot of work still needs to be done on this. The main problem is that eSpeak, unlike other TTS engines for which there are GNOME Speech drivers, doesn't automatically send the converted text to speech out to the audio device. This is left as an exercise for the application that wants to use it (in this case the GNOME speech driver for eSpeak). As it currently stands, the eSpeak GNOME Speech driver will segv when it attempts to call espeak_Synth(). From talking to the eSpeak author, you need to define an espeak_SetSynthCallback(). He sent me the sample.txt example showing how this would work. At the point I discovered that we would still need to handle the buffers of "wav" data returned, and send them to the audio device ourselves. That's as far as I took it. If somebody continues this work, they will need to do the following: * Fixup all the code that currently is surrounded by "#ifdef FIXUP". * Add in an espeak_SetSynthCallback() callback and send all the buffers of wav data to an audio device. This is not trivial, especially if we want to be able to interrupt it. The best way to test this new driver is the tes-speech program in the GNOME Speech test directory.
Oh I forgot to mention. You will need to get: eSpeak version 1.17b (or later) from: http://espeak.sourceforge.net/test/latest.html Earlier versions didn't have the ability to call the C++ routines in the eSpeak library from C programs. Jonathan has now added in the appropriate #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ ... #ifdef __cplusplus } #endif /* __cplusplus */ lines (thanks!).
See in attachment a possible eSpeak speech driver (compliant with eSpeak 1.18).
Created attachment 80193 [details] [review] eSpeak driver compliant with eSpeak 1.18 and gnome-speech (r266 svn)
Committed to gnome-speech SVN trunk and tested on Ubuntu Edgy system. Works great. Please pull the sources from SVN trunk, give them a shot, and let me know how it works. This should definitely make it into GNOME 2.18. Yeah! Thanks very much, Gilles.
Created attachment 80280 [details] [review] eSpeak driver (fix) Patch compliant with gnome-speech (r267) and eSpeak 1.18. * The default include directory is /usr/include/espeak. * The selected voice is now taken in account!
Committed. Thanks!
Created attachment 80462 [details] [review] languages + volume Patch compliant with r268 + eSpeak 1.18 Thanks to Jonathan Duddington for his re-reading and notices. * Max volume value = 200 (instead of 100). * Correct language name. * The first element of the voice list matches if possible the LANGUAGE variable (environment); otherwise the English language is the first element.
Committed. Thanks! I'm also taking care to mark the previous patches as committed and not obsolete. They each have been committed and the new patches build on, rather than obsolete, the previous patches. Thanks again for your hard work!
This driver has been in use for a while. Closing this as fixed. Thanks!