home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Multimed / Multimed.zip / fest-141.zip / festival / lib / init.scm < prev    next >
Lisp/Scheme  |  1999-10-14  |  6KB  |  156 lines

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;;                                                                       ;;
  3. ;;;                Centre for Speech Technology Research                  ;;
  4. ;;;                     University of Edinburgh, UK                       ;;
  5. ;;;                       Copyright (c) 1996,1997                         ;;
  6. ;;;                        All Rights Reserved.                           ;;
  7. ;;;                                                                       ;;
  8. ;;;  Permission is hereby granted, free of charge, to use and distribute  ;;
  9. ;;;  this software and its documentation without restriction, including   ;;
  10. ;;;  without limitation the rights to use, copy, modify, merge, publish,  ;;
  11. ;;;  distribute, sublicense, and/or sell copies of this work, and to      ;;
  12. ;;;  permit persons to whom this work is furnished to do so, subject to   ;;
  13. ;;;  the following conditions:                                            ;;
  14. ;;;   1. The code must retain the above copyright notice, this list of    ;;
  15. ;;;      conditions and the following disclaimer.                         ;;
  16. ;;;   2. Any modifications must be clearly marked as such.                ;;
  17. ;;;   3. Original authors' names are not deleted.                         ;;
  18. ;;;   4. The authors' names are not used to endorse or promote products   ;;
  19. ;;;      derived from this software without specific prior written        ;;
  20. ;;;      permission.                                                      ;;
  21. ;;;                                                                       ;;
  22. ;;;  THE UNIVERSITY OF EDINBURGH AND THE CONTRIBUTORS TO THIS WORK        ;;
  23. ;;;  DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING      ;;
  24. ;;;  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT   ;;
  25. ;;;  SHALL THE UNIVERSITY OF EDINBURGH NOR THE CONTRIBUTORS BE LIABLE     ;;
  26. ;;;  FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES    ;;
  27. ;;;  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN   ;;
  28. ;;;  AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,          ;;
  29. ;;;  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF       ;;
  30. ;;;  THIS SOFTWARE.                                                       ;;
  31. ;;;                                                                       ;;
  32. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  33. ;;;
  34. ;;;  Initialisation file -- loaded before anything else
  35. ;;;
  36. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  37.  
  38. ;;;  Basic siod library (need this before load_library or require works)
  39. (load (path-append libdir "siod.scm"))
  40.  
  41. (defvar home-directory (or (getenv "HOME") "/")
  42.   "home-directory
  43.    Place looked at for .festivalrc etc.")
  44.  
  45. ;;;  User startup initialization, can be used to override load-path
  46. ;;;  to allow alternate basic modules to be loaded.
  47. (if (probe_file (path-append home-directory ".siodvarsrc"))
  48.     (load (path-append home-directory ".siodvarsrc")))
  49.  
  50. (if (probe_file (path-append home-directory ".festivalvarsrc"))
  51.     (load (path-append home-directory ".festivalvarsrc")))
  52.  
  53. ;;;  A chance to set various variables to a local setting e.g.
  54. ;;;  lexdir, voices_dir audio etc etc.
  55. (if (probe_file (path-append libdir "sitevars.scm"))
  56.     (load (path-append libdir "sitevars.scm")))
  57.  
  58. ;;; CSTR siod extensions
  59. (require 'cstr)
  60.  
  61. ;;;  Festival specific definitions
  62. (require 'festival)
  63.  
  64. ;;;  Dealing with module descriptions
  65. (require 'module_description)
  66.  
  67. ;;;  Web related definitions
  68. (require 'web)
  69.  
  70. ;;;  Utterance types and support
  71. (require 'synthesis)
  72.  
  73. ;;;  Some default parameters
  74. (Parameter.def 'Wavefiletype 'nist)
  75.  
  76. ;;; Set default audio method
  77. (cond
  78.  ((member 'nas *modules*)
  79.   (Parameter.def 'Audio_Method 'netaudio))
  80.  ((member 'esd *modules*)
  81.   (Parameter.def 'Audio_Method 'esdaudio))
  82.  ((member 'sun16audio *modules*)
  83.   (Parameter.def 'Audio_Method 'sun16audio))
  84.  ((member 'freebsd16audio *modules*)
  85.   (Parameter.def 'Audio_Method 'freebsd16audio))
  86.  ((member 'linux16audio *modules*)
  87.   (Parameter.def 'Audio_Method 'linux16audio))
  88.  ((member 'irixaudio *modules*)
  89.   (Parameter.def 'Audio_Method 'irixaudio))
  90.  ((member 'win32audio *modules*)
  91.   (Parameter.def 'Audio_Method 'win32audio))
  92.  ((member 'os2audio *modules*)
  93.   (Parameter.def 'Audio_Method 'os2audio))
  94.  ((member 'mplayeraudio *modules*)
  95.   (Parameter.def 'Audio_Method 'mplayeraudio))
  96.  (t  ;; can't find direct support so guess that /dev/audio for 8k ulaw exists
  97.   (Parameter.def 'Audio_Method 'sunaudio)))
  98. ;;;  If you have an external program to play audio add its definition
  99. ;;;  in siteinit.scm
  100.  
  101. ;;; The audio spooler doesn't work under Windows so redefine audio_mode
  102. (if (member 'mplayeraudio *modules*)
  103.       (define (audio_mode param) param)
  104. )
  105.  
  106. ;;; Intonation
  107. (require 'intonation)
  108.  
  109. ;;; Duration
  110. (require 'duration)
  111.  
  112. ;;;  A large lexicon
  113. (require 'lexicons)
  114. (require 'pauses)
  115.  
  116. ;;;  Part of speech prediction
  117. (require 'pos)
  118.  
  119. ;;; Phrasing (dependent on pos)
  120. (require 'phrase)
  121.  
  122. ;;; POstlexical rules
  123. (require 'postlex)
  124.  
  125. ;;; Different voices
  126. (require 'voices)  ;; sets voice_default
  127. (require 'languages)
  128.  
  129. ;;; Some higher level functions
  130. (require 'token)
  131. (require 'tts)
  132.  
  133. ;;;
  134. ;;;  Local site initialization, if the file exists load it
  135. ;;;
  136. (if (probe_file (path-append libdir "siteinit.scm"))
  137.     (load (path-append libdir "siteinit.scm")))
  138.  
  139. ;;;  User initialization, if a user has a personal customization
  140. ;;;  file loaded it
  141. (if (probe_file (path-append home-directory ".siodrc"))
  142.     (load (path-append home-directory ".siodrc")))
  143.  
  144. (if (probe_file (path-append home-directory ".festivalrc"))
  145.     (load (path-append home-directory ".festivalrc")))
  146.  
  147. ;;; Default voice (have to do something cute so autoloads still work)
  148. (eval (list voice_default))
  149.  
  150. (provide 'init)
  151.  
  152.  
  153.  
  154.  
  155.  
  156.