README.festival 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. app_festival is an application that allows one to send text-to-speech commands
  2. to a background festival server, and to obtain the resulting waveform which
  3. gets sent down to the respective channel. app_festival also employs a waveform
  4. cache, so invariant text-to-speech strings ("Please press 1 for instructions")
  5. do not need to be dynamically generated all the time.
  6. You need :
  7. 1) festival, patched to produce 8khz waveforms on output. Patch for Festival
  8. 1.4.2 RELEASE are included. The patch adds a new command to festival
  9. (asterisk_tts).
  10. It is possible to run Festival without patches in the source-code. Just
  11. add this to your /etc/festival.scm or /usr/share/festival/festival/scm:
  12. (define (tts_textasterisk string mode)
  13. "(tts_textasterisk STRING MODE)
  14. Apply tts to STRING. This function is specifically designed for
  15. use in server mode so a single function call may synthesize the string.
  16. This function name may be added to the server safe functions."
  17. (let ((wholeutt (utt.synth (eval (list 'Utterance 'Text string)))))
  18. (utt.wave.resample wholeutt 8000)
  19. (utt.wave.rescale wholeutt 5)
  20. (utt.send.wave.client wholeutt)))
  21. [See the comment with subject "Using Debian
  22. festival >= 1.4.3-15 (no recompiling needed!)" on
  23. http://www.voip-info.org/wiki-Asterisk+festival+installation for the
  24. original mentioning of it]
  25. 2) You may wish to obtain and install the asterisk-perl
  26. module by James Golovich <james@gnuinter.net>, from
  27. either CPAN, or his site: http://asterisk.gnuinter.net,
  28. as this contains a good example of how variable text
  29. can be tts'd via asterisk, namely the examples/tts-*.agi
  30. files there. It has been noted that the current expression
  31. evaluation capabilities of asterisk are not best suited
  32. for the generation and manipulation of text. AGI scripting
  33. can be ideal for these sorts of needs. For simpler usage,
  34. fixed, pre-recorded messages may be more amenable for your
  35. purposes.
  36. 3) Before running asterisk, you have to run festival-server with a command
  37. like :
  38. /usr/local/festival/bin/festival --server > /dev/null 2>&1 &