Let's also include aclocal.m4
[asterisk-bristuff.git] / contrib / festival-1.95.diff
blob2035d7f0f690c218f7d41cd9465c333996524382
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))))))
22 +;; begin tts_textasterisk
23 +(define (tts_textasterisk string mode)
24 + "(tts_textasterisk STRING MODE)
25 +Apply tts to STRING. This function is specifically designed for
26 +use in server mode so a single function call may synthesize the string.
27 +This function name may be added to the server safe functions."
28 + (utt.send.wave.asterisk
29 + (utt.synth
30 + (eval (list 'Utterance 'Text string)))))
31 +;; end tts_textasterisk
33 (define (tts_return_to_client)
34 "(tts_return_to_client)
35 This function is called by clients who wish to return waveforms of
36 diff -ur festival-195orig/festival/src/arch/festival/wave.cc festival-195/festival/src/arch/festival/wave.cc
37 --- festival-195orig/festival/src/arch/festival/wave.cc 2004-06-21 14:52:42.000000000 -0600
38 +++ festival-195/festival/src/arch/festival/wave.cc 2005-01-04 09:26:24.000000000 -0700
39 @@ -482,6 +482,7 @@
40 type = "nist";
41 else
42 type = get_c_string(ltype);
44 w->save(tmpfile,type);
45 #ifdef WIN32
46 send(ft_server_socket,"WV\n",3,0);
47 @@ -494,6 +495,44 @@
48 return utt;
51 +// begin utt_send_wave_asterisk()
52 +static LISP utt_send_wave_asterisk(LISP utt)
54 + // Send the waveform to a client (must be acting as server)
55 + EST_Utterance *u = utterance(utt);
56 + EST_Wave *w;
57 + EST_String tmpfile = make_tmp_filename();
58 + LISP ltype;
59 + EST_String type;
61 + w = get_utt_wave(u);
62 + if (ft_server_socket == -1)
63 + {
64 + cerr << "utt_send_wave_asterisk: not in server mode" << endl;
65 + festival_error();
66 + }
68 + ltype = ft_get_param("Wavefiletype");
69 + if (ltype == NIL)
70 + type = "nist";
71 + else
72 + type = get_c_string(ltype);
73 + w->resample(8000);
74 + w->rescale(5);
76 + w->save(tmpfile,type);
77 +#ifdef WIN32
78 + send(ft_server_socket,"WV\n",3,0);
79 +#else
80 + write(ft_server_socket,"WV\n",3);
81 +#endif
82 + socket_send_file(ft_server_socket,tmpfile);
83 + unlink(tmpfile);
85 + return utt;
87 +// end utt_send_wave_asterisk()
89 static LISP send_sexpr_to_client(LISP l)
91 EST_String tmpfile = make_tmp_filename();
92 @@ -595,6 +634,15 @@
93 "(utt.send.wave.client UTT)\n\
94 Sends wave in UTT to client. If not in server mode gives an error\n\
95 Note the client must be expecting to receive the waveform.");
97 +// begin asterisk mod
98 + init_subr_1("utt.send.wave.asterisk",utt_send_wave_asterisk,
99 + "(utt.send.wave.asterisk UTT)\n\
100 + Sends wave in UTT to client. If not in server mode gives an error\n\
101 + Note the client must be expecting to receive the waveform. The waveform\n\
102 + is rescaled and resampled according to what asterisk needs");
103 +// end asterisk mod
105 init_subr_1("send_sexpr_to_client", send_sexpr_to_client,
106 "(send_sexpr_to_client SEXPR)\n\
107 Sends given sexpression to currently connected client.");