Skip to main content

mod_ssml

About

mod_ssml implements the SSML (Speech Synthesis Markup Language) and TTS (text-to-speech) file formats.

This module is used primarily by mod_rayo.

Installing

Tell FreeSWITCH to compile in this module by editing modules.conf in /usr/src/freeswitch/trunk and adding:

 formats/mod_ssml

Now go recompile FreeSWITCH.

make
make install

Tell FreeSWITCH to actually use the module when running by adding the module to modules.conf.xml in /usr/local/freeswitch/conf/autoload_configs:

<load module="mod_ssml"/>

ssml.conf.xml Configuration

The conf/autoload_configs/ssml.conf.xml file contains the configuration. An example configuration is located in formats/mod_ssml/conf/autoload_configs/ssml.conf.xml.

It is recommended that you start with the example config and adjust the settings as needed!

tts-voices

This section defines all the available voice languages and genders. mod_ssml will search these voices for the closet match.

    <!-- voices in order of preference -->
<tts-voices>
<voice name="slt" language="en-US" gender="female" prefix="tts://flite|slt|"/>
<voice name="kal" language="en-US" gender="male" prefix="tts://flite|kal|"/>
<voice name="rms" language="en-US" gender="male" prefix="tts://flite|rms|"/>
<voice name="awb" language="en-US" gender="male" prefix="tts://flite|awb|"/>
</tts-voices>

Say module integration

These sections map languages to the appropriate FreeSWITCH say module (like mod_say_en), define say voices in order of preference, and map interpret-as to the say types and methods

    <!-- say voices in order of preference -->
<say-voices>
<voice name="callie" language="en-US" gender="female" prefix="$${sounds_dir}/en/us/callie/"/>
</say-voices>

<!-- maps ISO language to say module -->
<language-map>
<language iso="en-US" say-module="en" language="en"/>
</language-map>

<!-- map interpret-as to say macros -->
<macros>
<macro name="cardinal" method="pronounced" type="number"/>
<macro name="characters" method="pronounced" type="name_spelled"/>
</macros>

ssml:// format

To use the format:

ssml://<speak xmlns="http://www.w3.org/2001/10/synthesis" version="1.0" xml:lang="en-US"><p>Hello there!</p></speak>

tts:// format

To use the format:

  tts://flite|slt|Hello there!