home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Multimed / Multimed.zip / fest-141.zip / festival / lib / languages.scm < prev    next >
Text File  |  1999-05-30  |  5KB  |  121 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. ;;;  Specification of voices and some major choices of synthesis
  35. ;;;
  36. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  37. ;;;
  38. ;;;  This should use some sort of database description for voices so
  39. ;;;  new voices will become automatically available.
  40. ;;;
  41.  
  42. (define (language_british_english)
  43. "(language_british_english)
  44. Set up language parameters for British English."
  45.   (require 'voices)
  46.   ;;  Will get more elaborate, with different choices of voices in language
  47.  
  48.   (set! male1 voice_rab_diphone)
  49.   (set! male2 voice_don_diphone)
  50.   (if (symbol-bound? 'voice_gsw_diphone)
  51.       (set! male3 voice_gsw_diphone))
  52.   (if (symbol-bound? 'voice_gsw_450)
  53.       (set! male4 voice_gsw_450))
  54.  
  55.   (male1)
  56.   (Parameter.set 'Language 'britishenglish)
  57. )
  58.  
  59. (define (language_american_english)
  60. "(language_american_english)
  61. Set up language parameters for Aemerican English."
  62.  
  63.   (if (symbol-bound? 'voice_kal_diphone)
  64.       (set! female1 voice_kal_diphone))
  65.   (set! male1 voice_ked_diphone)
  66.  
  67.   (male1)
  68.   (Parameter.set 'Language 'americanenglish)
  69. )
  70.  
  71. (define (language_scots_gaelic)
  72. "(language_scots_gaelic)
  73. Set up language parameters for Scots Gaelic."
  74.   (error "Scots Gaelic not yet supported.")
  75.  
  76.   (Parameter.set 'Language 'scotsgaelic)
  77. )
  78.  
  79. (define (language_welsh)
  80. "(language_welsh)
  81. Set up language parameters for Welsh."
  82.  
  83.   (set! male1 voice_welsh_hl)
  84.  
  85.   (male1)
  86.   (Parameter.set 'Language 'welsh)
  87. )
  88.  
  89. (define (language_castillian_spanish)
  90. "(language_spanish)
  91. Set up language parameters for Castillian Spanish."
  92.  
  93.   (voice_el_diphone)
  94.   (set! male1 voice_el_diphone)
  95.  
  96.   (Parameter.set 'Language 'spanish)
  97. )
  98.  
  99. (define (select_language language)
  100.   (cond
  101.    ((or (equal? language 'britishenglish)
  102.     (equal? language 'english))  ;; we all know its the *real* English
  103.     (language_british_english))
  104.    ((equal? language 'americanenglish)
  105.     (language_american_english))
  106.    ((equal? language 'scotsgaelic)
  107.     (language_scots_gaelic))
  108.    ((equal? language 'welsh)
  109.     (language_welsh))
  110.    ((equal? language 'spanish)
  111.     (language_castillian_spanish))
  112.    ((equal? language 'klingon)
  113.     (language_klingon))
  114.    (t
  115.     (print "Unspoorted language, using English")
  116.     (language_british_english))))
  117.  
  118. (defvar language_default language_british_english)
  119.  
  120. (provide 'languages)
  121.