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