festival-1.95.diff 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. diff -ur festival-195orig/festival/lib/multisyn/multisyn_pauses.scm festival-195/festival/lib/multisyn/multisyn_pauses.scm
  2. --- festival-195orig/festival/lib/multisyn/multisyn_pauses.scm 2004-06-21 08:19:30.000000000 -0600
  3. +++ festival-195/festival/lib/multisyn/multisyn_pauses.scm 2005-01-12 18:53:27.000000000 -0700
  4. @@ -85,8 +85,8 @@
  5. (let ((silence (car (cadr (car (PhoneSet.description '(silences))))))
  6. (seg (item.relation (find_last_seg word) 'Segment))
  7. pause_item)
  8. - (format t " inserting pause after: %s.\n" (item.name seg))
  9. - (format t " Inserting pause\n")
  10. +; (format t " inserting pause after: %s.\n" (item.name seg))
  11. +; (format t " Inserting pause\n")
  12. ; if next seg is not silence insert one.
  13. (if (or (not (item.next seg))
  14. (not (string-equal (item.name (item.next seg)) silence)))
  15. diff -ur festival-195orig/festival/lib/tts.scm festival-195/festival/lib/tts.scm
  16. --- festival-195orig/festival/lib/tts.scm 2003-04-20 10:42:28.000000000 -0600
  17. +++ festival-195/festival/lib/tts.scm 2005-01-04 09:21:31.000000000 -0700
  18. @@ -235,6 +235,17 @@
  19. (utt.synth
  20. (eval (list 'Utterance 'Text string))))))
  21. +;; begin tts_textasterisk
  22. +(define (tts_textasterisk string mode)
  23. + "(tts_textasterisk STRING MODE)
  24. +Apply tts to STRING. This function is specifically designed for
  25. +use in server mode so a single function call may synthesize the string.
  26. +This function name may be added to the server safe functions."
  27. + (utt.send.wave.asterisk
  28. + (utt.synth
  29. + (eval (list 'Utterance 'Text string)))))
  30. +;; end tts_textasterisk
  31. +
  32. (define (tts_return_to_client)
  33. "(tts_return_to_client)
  34. This function is called by clients who wish to return waveforms of
  35. diff -ur festival-195orig/festival/src/arch/festival/wave.cc festival-195/festival/src/arch/festival/wave.cc
  36. --- festival-195orig/festival/src/arch/festival/wave.cc 2004-06-21 14:52:42.000000000 -0600
  37. +++ festival-195/festival/src/arch/festival/wave.cc 2005-01-04 09:26:24.000000000 -0700
  38. @@ -482,6 +482,7 @@
  39. type = "nist";
  40. else
  41. type = get_c_string(ltype);
  42. +
  43. w->save(tmpfile,type);
  44. #ifdef WIN32
  45. send(ft_server_socket,"WV\n",3,0);
  46. @@ -494,6 +495,44 @@
  47. return utt;
  48. }
  49. +// begin utt_send_wave_asterisk()
  50. +static LISP utt_send_wave_asterisk(LISP utt)
  51. +{
  52. + // Send the waveform to a client (must be acting as server)
  53. + EST_Utterance *u = utterance(utt);
  54. + EST_Wave *w;
  55. + EST_String tmpfile = make_tmp_filename();
  56. + LISP ltype;
  57. + EST_String type;
  58. +
  59. + w = get_utt_wave(u);
  60. + if (ft_server_socket == -1)
  61. + {
  62. + cerr << "utt_send_wave_asterisk: not in server mode" << endl;
  63. + festival_error();
  64. + }
  65. +
  66. + ltype = ft_get_param("Wavefiletype");
  67. + if (ltype == NIL)
  68. + type = "nist";
  69. + else
  70. + type = get_c_string(ltype);
  71. + w->resample(8000);
  72. + w->rescale(5);
  73. +
  74. + w->save(tmpfile,type);
  75. +#ifdef WIN32
  76. + send(ft_server_socket,"WV\n",3,0);
  77. +#else
  78. + write(ft_server_socket,"WV\n",3);
  79. +#endif
  80. + socket_send_file(ft_server_socket,tmpfile);
  81. + unlink(tmpfile);
  82. +
  83. + return utt;
  84. +}
  85. +// end utt_send_wave_asterisk()
  86. +
  87. static LISP send_sexpr_to_client(LISP l)
  88. {
  89. EST_String tmpfile = make_tmp_filename();
  90. @@ -595,6 +634,15 @@
  91. "(utt.send.wave.client UTT)\n\
  92. Sends wave in UTT to client. If not in server mode gives an error\n\
  93. Note the client must be expecting to receive the waveform.");
  94. +
  95. +// begin asterisk mod
  96. + init_subr_1("utt.send.wave.asterisk",utt_send_wave_asterisk,
  97. + "(utt.send.wave.asterisk UTT)\n\
  98. + Sends wave in UTT to client. If not in server mode gives an error\n\
  99. + Note the client must be expecting to receive the waveform. The waveform\n\
  100. + is rescaled and resampled according to what asterisk needs");
  101. +// end asterisk mod
  102. +
  103. init_subr_1("send_sexpr_to_client", send_sexpr_to_client,
  104. "(send_sexpr_to_client SEXPR)\n\
  105. Sends given sexpression to currently connected client.");