festival-1.4.1-diff 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. diff -ruN festival/lib/tts.scm myfestival/lib/tts.scm
  2. --- festival/lib/tts.scm Sun May 30 16:40:00 1999
  3. +++ myfestival/lib/tts.scm Wed Apr 17 22:29:34 2002
  4. @@ -200,6 +200,15 @@
  5. (utt.synth
  6. (eval (list 'Utterance 'Text string)))))
  7. +(define (tts_textasterisk string mode)
  8. + "(tts_textasterisk STRING MODE)
  9. +Apply tts to STRING. This function is specifically designed for
  10. +use in server mode so a single function call may synthesize the string.
  11. +This function name maybe added to the server safe functions."
  12. + (utt.send.wave.asterisk
  13. + (utt.synth
  14. + (eval (list 'Utterance 'Text string)))))
  15. +
  16. (define (tts_return_to_client)
  17. "(tts_return_to_client)
  18. This function is called by clients who wish to return waveforms of
  19. diff -ruN festival/src/arch/festival/wave.cc myfestival/src/arch/festival/wave.cc
  20. --- festival/src/arch/festival/wave.cc Sat Jun 12 10:30:30 1999
  21. +++ myfestival/src/arch/festival/wave.cc Thu Apr 18 10:55:32 2002
  22. @@ -375,6 +375,38 @@
  23. type = "nist";
  24. else
  25. type = get_c_string(ltype);
  26. +
  27. + w->save(tmpfile,type);
  28. + write(ft_server_socket,"WV\n",3);
  29. + socket_send_file(ft_server_socket,tmpfile);
  30. + unlink(tmpfile);
  31. +
  32. + return utt;
  33. +}
  34. +
  35. +static LISP utt_send_wave_asterisk(LISP utt)
  36. +{
  37. + // Send the waveform to a client (must be acting as server)
  38. + EST_Utterance *u = utterance(utt);
  39. + EST_Wave *w;
  40. + EST_String tmpfile = make_tmp_filename();
  41. + LISP ltype;
  42. + EST_String type;
  43. +
  44. + w = get_utt_wave(u);
  45. + if (ft_server_socket == -1)
  46. + {
  47. + cerr << "utt_send_wave_client: not in server mode" << endl;
  48. + festival_error();
  49. + }
  50. +
  51. + ltype = ft_get_param("Wavefiletype");
  52. + if (ltype == NIL)
  53. + type = "nist";
  54. + else
  55. + type = get_c_string(ltype);
  56. + w->resample(8000);
  57. + w->rescale(5);
  58. w->save(tmpfile,type);
  59. write(ft_server_socket,"WV\n",3);
  60. socket_send_file(ft_server_socket,tmpfile);
  61. @@ -434,6 +466,13 @@
  62. "(utt.send.wave.client UTT)\n\
  63. Sends wave in UTT to client. If not in server mode gives an error\n\
  64. Note the client must be expecting to receive the waveform.");
  65. +
  66. + init_subr_1("utt.send.wave.asterisk",utt_send_wave_asterisk,
  67. + "(utt.send.wave.asterisk UTT)\n\
  68. + Sends wave in UTT to client. If not in server mode gives an error\n\
  69. + Note the client must be expecting to receive the waveform. The waveform\n\
  70. + is rescaled and resampled according to what asterisk needs");
  71. +
  72. init_subr_2("utt.save.f0",utt_save_f0,
  73. "(utt.save.f0 UTT FILENAME)\n\
  74. Save F0 of UTT as esps track file in FILENAME.");