Espeak Gstreamer Plugin

This is a tutorial on how to set up Espeak TTS as a GStreamer plugin under Linux/Ubuntu. You should  probably have installed the gstreamer libraries and headers previous to this step.

*) Download and install PortAudio and other required libraries and header files
$ sudo apt-get install portaudio19-dev libxml2

*) Download and install espeak sources from http://espeak.sourceforge.net/download.html (currently 1.46.02)
$ unzip espeak-1.46.02-source.zip
$ cd espeak-1.46.02-source/src
$ rm portaudio*

*) change the two files wavegen.cpp and wave.cpp by replacing
#include "portaudio.h"
#include "/usr/include/portaudio.h"
in each of the files.

*) Compile and install espeak
$ make
$ sudo make install

*) Download and install the espeak gst-plugin from Sugar Labs (http://download.sugarlabs.org/sources/honey/gst-plugins-espeak/ - currently version 0.3.5)
$ wget http://download.sugarlabs.org/sources/honey/gst-plugins-espeak/gst-plugins-espeak-0.3.5.tar.gz
$ tar xvf gst-plugins-espeak-0.3.5.tar.gz
$ cd gst-plugins-espeak-0.3.5
$ ./configure
$ make
$ sudo make install

Installing the ladspa plugin support
The ladspa gst-bad plugins contains a few cool filters. In my example, i use the "speed" filter to controll the pitch of the output voice. This part will cover how to make the ladspa filters working.

*) install the ladspa headers and the "gst-bad" plugins
$ sudo apt-get install ladspa-sdk gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse

*) download and install the latest ladspa sources from http://www.ladspa.org/download
$ wget http://www.ladspa.org/download/cmt_src.tgz
$ tar xvf cmt_src.tgz
$ cd cmt/src
$ make
$ sudo make install
$ cd ../..
$ wget http://www.ladspa.org/download/ladspa_sdk.tgz
$ tar xvf ladspa_sdk.tgz
$ cd ladspa_sdk/src
$ make
$ sudo make install

You might need to add the plug in path. Do it by adding this to your ~/.bashrc file:
export GST_PLUGIN_PATH=/usr/local/lib:/usr/lib/gstreamer-0.10

Example code can be found at: https://github.com/lastbil2000/Example/tree/master/Espeak

No comments:

Post a Comment