[Freeswitch-users] tts_commandline question

Mathieu Parent math.parent at gmail.com
Tue Dec 14 17:56:17 MSK 2010


2010/12/14 Phone <phone.bytes at gmail.com>:
> Hi Mathieu,
>
> I have been trying to use mod_cepstral.  I had trouble with it hanging and
> needing to restart freeswitch after funning only a few hours.
>
> MC suggested that I try tts_commandline to see if that worked better.  I did
> and found I did not have any issues doing cepstral this way.
>
> However, my need is to be able to feed a text file to Swift instead of
> sending the text on the command line.  I have tried using a -f switch as
> Swift allows, but it seems that tts_commandline does not support this
> option.

mod_tts_commandline only work with text as a ARG. ${text} is replaced
by the actual string, quoted (for security reasons).

>
> Am I missing something here or is there another way of doing this?

You probably want to use cepstral as a system command
(http://wiki.freeswitch.org/wiki/Mod_commands#system) and the playback
(http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_playback).

> Following is a piece of a trace from the log.
>
> It seems to almost build the swift command correctly.  However, the -f
> option is inside the single quotes, instead of outside of them like the -o
> (output file) is.
>
> I don't think it is finding the .txt file, as the log later shows that it is
> trying to speak the filename including the -f option, instead of the
> contents of the file.
>
> Thanks
>
> EXECUTE FreeTDM/1:1/7878030 speak(tts_commandline|Callie|-f/tmp/test.txt)
> 2010-12-11 00:26:58.683522 [DEBUG] switch_ivr_play_say.c:2237 OPEN TTS
> tts_commandline
> 2010-12-11 00:26:58.683522 [DEBUG] switch_ivr_play_say.c:2246 Raw Codec
> Activated
> 2010-12-11 00:26:58.683522 [DEBUG] mod_tts_commandline.c:147 Executing:
> swift -p audio/sampling-rate=8000 -n 'Callie' '-f/tmp/test.txt'  -o
> '/tmp/bd5bb8db-ffc2-4830-a971-24a1454c725c.tmp.wav'
> 2010-12-11 00:26:58.696525 [ERR] mod_sndfile.c:194 Error Opening File
> [/tmp/bd5bb8db-ffc2-4830-a971-24a1454c725c.tmp.wav] [System error : No such
> file or directory.]
> 2010-12-11 00:26:58.696525 [ERR] mod_tts_commandline.c:157 Failed to open
> file: /tmp/bd5bb8db-ffc2-4830-a971-24a1454c725c.tmp.wav
> 2010-12-11 00:26:58.696525 [DEBUG] switch_ivr_play_say.c:1935 Speaking text:
> -f/tmp/test.txt
> 2010-12-11 00:26:59.097509 [DEBUG] switch_ivr_play_say.c:2127 done speaking
> text
>
>
>
>



-- 
Mathieu



More information about the FreeSWITCH-users mailing list