Bug#217007: festival with asterisk

Angus Lees Angus Lees <gus@debian.org>, 217007@bugs.debian.org
Mon, 22 Nov 2004 10:45:28 +1100


With the newly patched festival, all you need to get asterisk working
with festival is to put the following into /etc/festival.scm, and
comment out the "exit 0" from /etc/init.d/festival (and (re)start your
festival server):

 (define (tts_textasterisk string mode)
   "(tts_textasterisk STRING MODE)
 Apply tts to STRING.  This function is specifically designed for
 use in server mode so a single function call may synthesize the string.
 This function name may be added to the server safe functions."
   (let ((wholeutt (utt.synth (eval (list 'Utterance 'Text string)))))
    (utt.wave.resample wholeutt 8000)
    (utt.wave.rescale wholeutt 5)
    (utt.send.wave.client wholeutt)))

festivalcommand (in /etc/asterisk/festival.conf) should remain with
the default "(tts_textasterisk "%s" 'file)(quit)\n"

I suggest you add this to README.Debian or something, as there seems
to be a whole lot of ancient documentation (and misinformation) around
that still says you need to patch festival (including someone who
"updated" the asterisk/contrib hack to apply over the Debian festival
patch).


An alternative is to set festivalcommand to do the above itself
(without needing to modify /etc/festival.scm).  This looks uglier, but
has the advantage that the asterisk package could make it work "out of
the box".  ie:

 festivalcommand=(utt.send.wave.client (utt.wave.resample (utt.wave.rescale (utt.synth (eval (list 'Utterance 'Text "%s"))) 5) 8000))(quit)\n

-- 
 - Gus