mod_tts_commandline
About
Run a command line and play the output file.
It is mainly for testing purpose. It may not fit for extensive use (but it may). Once you have chosen your TTS engine, write a native module!
Click here to expand Table of Contents
- 1 Installing mod_tts_commandline
- 2 Configuring mod_tts_commandline
- 3 Example commands
- 4 Notes on svox pico
Installing mod_tts_commandline
- In modules.conf, add asr_tts/mod_tts_commandline.
Linux:
- Run make, make install.
Windows:
- copy the msvc project from freeswitch-contrib in grmt\mod_tts_commandline for windows
- add project to Freeswitch.2010.sln and build it (sorry, I didn't test MSVC 2008)
Configuring mod_tts_commandline
- In freeswitch/conf/autoload_configs/modules.conf.xml, uncomment <load module="mod_tts_commandline"/>.
- Edit conf/autoload_configs/tts_commandline.conf.xml.
- Reload configuration by reloadxml (or restarting FreeSWITCH)
- Add tts_commandline to dialplan (or phrase, etc.) like this:
<action application="speak" data="tts_commandline|pico|This is an example of using tts_commandline"/>
Example commands
Using festival's text2wave:
echo ${text} | text2wave -f ${rate} > ${file}
Using festival's server client:
echo ${text} | festival_client --server xxx.xxx.xxx.xxx --otype riff --ttw --output ${file}
(may be needed adjust festival's default sample rate on server)
Using Cepstral's swift:
swift -n ${voice} ${text} -o ${file}
Using espeak (using sox to adjust sample rate):
echo ${text} | espeak --stdin -v ${voice} --stdout | sox -t wav - -r ${rate} ${file}
Using espeak + mbrola :
echo ${text} | espeak --stdin -v mb/mb-fr4 | mbrola -e /usr/share/mbrola/voices/fr4 - -.au | sox -t au - -r ${rate} ${file}
Using lliaphon + mbrola (French voice fr4) (NB it does not work for me):
echo ${text} | (lliaphon 2>/dev/null) | mbrola -e -f 1.0 -t 0.6 -l 8000 -I /usr/local/share/lliaphon/initfile.lia /usr/share/mbrola/voices/fr4 - ${file}
Using svox pico (from the Android project - supports it-IT, fr-FR, es-ES, de-DE, en-US and en-GB languages:
pico2wave --lang=fr-FR --wave=/tmp/$$.wav ${text} && sox /tmp/$$.wav -r ${rate} ${file} && rm /tmp/$$.wav
(You should apply patches from here (see also issue 4362 and issue 4363)
Write your own here...