No text-to-speech with Flite on Freeswitch/ IVR

If you have configured a feature code that uses text-to-speech e.g. a talking clock or if you are setting up an auto attendant (IVR) on a new system and you have selected the flite voice but when you connect to the auto attendant Assigned Number you get no message audio even though you have selected the Flite voice then you can test this problem very quickly.

Look at the freeswitch console log and you should see a error message,

2012-12-26 09:57:14.381330 [ERR] switch_core_speech.c:61 Invalid speech module [flite]!
2012-12-26 09:57:14.381330 [ERR] switch_ivr_play_say.c:2439 Invalid TTS module!

If you are not at the console and if you are testing an IVR then connect to the IVR from a phone and  hit one of the key mapping option numbers that you have configured for it to action and if this works (which they probably will) then your problem is that you have not enabled the mod_flite in Freeswitch source modules.conf or the module is not automatically loading.

This is easy to fix. Edit the /usr/local/src/freeswitch/modules.conf  and uncomment the line,


(also make sure that you have mod_cepstral commented out as you can’t use flite and cepstral at the same time. Cepstral is licensed, albeit not very expensive – about 30 dollars per voice – and you can test with their TTS voices though the TTS engine will periodically insert nag messages.)

Now do a make on Freeswitch. This will see that you have enabled the mod_flite and it will download the flite package from  (about 14 Megabytes).

Note that if you break the download then you must cd to /usr/local/src/freeswitch/libs and sudo rm -R flite-1.5.1-current*  or similar to clean up the broken download and then run make again.

After the make then do a make install.

Once that has done (or perhaps you had already had that uncommented) then you must make sure that the module is autoloaded. To check this go to the runtime program path which is usually /usr/local/freeswitch) e.g.

cd /usr/local/freeswitch/conf/autoload_configs

and edit the  modules.conf.xml and again uncomment the mod_flite line so it is  the only one uncommented,

  <!-- ASR /TTS -->
    <load module="mod_flite"/> <!-- -->
    <!-- <load module="mod_pocketsphinx"/> -->
    <!-- <load module="mod_cepstral"/> -->
    <!-- <load module="mod_tts_commandline"/> -->
    <!-- <load module="mod_rss"/> -->

now restart freeswitch. Your feature code text to speech will now work.

Truthfully though the Flite TTS is synthetic (e.g. the rms voice) and will never be as good as a human spoken voice but it does allow you to quickly setup what option codes to use and test your options before you get a human speaker to say a script.

If you are getting someone to say the script (or yourself !) in-house and want a low-cost recording solution without a professional sound recording setup then I use Audacity with an ordinary microphone (VOIP headset) and a sheet of copy paper as a de-popper. See my post here for details.