Mod flite

From FreeSWITCH Wiki
Jump to: navigation, search
  • Flite (aka Festival Lite) is a small embeddable TTS (Text to Speech) engine that's totally free.
  • Works on FreeBSD, Mac, Linux and Windows.
  • Don't load mod_cepstral and mod_flite at the same time. (symbol collision).
  • Voices are 16khz, and are:
    • slt (female voice)
    • rms (male voice)
    • awb (male voice)
    • kal (male voice)

Installing mod_flite

  • In modules.conf uncomment asr_tts/mod_flite; (note that's the one at the top level of your src directory and NOT to be confused with the freeswitch/conf/modules.conf.xml file which you will also have to edit later - see below). This installation has been written assuming that you are going to be compiling this module.

Comment out asr_tts/mod_cepstral from the same file. Both modules cannot be used together.

  • Run make, make install.
  • In freeswitch/conf/autoload_configs/modules.conf.xml, uncomment <load module="mod_flite"/>. Comment out <load module="mod_cepstral"/>.

Using mod_flite

    <extension name="flite">
      <condition field="destination_number" expression="^9886$">
        <action application="set" data="tts_engine=flite"/>
        <action application="set" data="tts_voice=kal"/>
        <action application="speak" data="This is flite on FreeSWITCH"/>
      </condition>
    </extension>

To set volume at your desired level

 <action application="set_audio_level" data="write 4"/>
 <action application="set_audio_level" data="read 4"/>

write for output audio stream and read for incoming audio stream. read and write can take integral values from 4 to -4