diff -aur festival-orig/src/arch/festival/client.cc festival-patched/src/arch/festival/client.cc --- festival-orig/src/arch/festival/client.cc 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/arch/festival/client.cc 2006-12-12 17:08:52.000000000 +0100 @@ -49,6 +49,9 @@ #include "festival.h" #include "festivalP.h" +using std::cerr; +using std::endl; + static EST_Regex ipnum("[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+"); int festival_socket_client(const char *host,int port) diff -aur festival-orig/src/arch/festival/features.cc festival-patched/src/arch/festival/features.cc --- festival-orig/src/arch/festival/features.cc 2004-05-03 21:26:37.000000000 +0200 +++ festival-patched/src/arch/festival/features.cc 2006-12-12 17:08:52.000000000 +0100 @@ -79,6 +79,9 @@ #include "festival.h" #include "festivalP.h" +using std::cerr; +using std::endl; + static LISP ff_pref_assoc(const char *name, LISP alist); static LISP ff_docstrings = NULL; diff -aur festival-orig/src/arch/festival/festival.cc festival-patched/src/arch/festival/festival.cc --- festival-orig/src/arch/festival/festival.cc 2004-05-24 22:14:33.000000000 +0200 +++ festival-patched/src/arch/festival/festival.cc 2006-12-12 17:08:52.000000000 +0100 @@ -46,6 +46,8 @@ #include "siod.h" #include "ModuleDescription.h" +using namespace std; + static void festival_lisp_funcs(void); static void festival_lisp_vars(void); static void festival_banner(void); diff -aur festival-orig/src/arch/festival/festivalP.h festival-patched/src/arch/festival/festivalP.h --- festival-orig/src/arch/festival/festivalP.h 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/arch/festival/festivalP.h 2006-12-12 17:08:52.000000000 +0100 @@ -50,7 +50,7 @@ void festival_wfst_init(); void festival_fringe_init(void); -extern ostream *cslog; +extern std::ostream *cslog; LISP l_audio_mode(LISP mode); void audsp_play_wave(EST_Wave *w); diff -aur festival-orig/src/arch/festival/ModuleDescription.cc festival-patched/src/arch/festival/ModuleDescription.cc --- festival-orig/src/arch/festival/ModuleDescription.cc 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/arch/festival/ModuleDescription.cc 2006-12-12 17:08:52.000000000 +0100 @@ -38,10 +38,12 @@ /* */ /*************************************************************************/ -#include <iostream.h> +#include <iostream> #include "siod.h" #include "ModuleDescription.h" +using std::ostream; + // to make life easier static inline EST_String S(const char *s) { return EST_String(s); } diff -aur festival-orig/src/arch/festival/ngram.cc festival-patched/src/arch/festival/ngram.cc --- festival-orig/src/arch/festival/ngram.cc 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/arch/festival/ngram.cc 2006-12-12 17:08:52.000000000 +0100 @@ -40,6 +40,9 @@ #include "festival.h" #include "festivalP.h" +using std::cout; +using std::endl; + static LISP ngram_loaded_list = NIL; static EST_Ngrammar *load_ngram(const EST_String &filename); static LISP add_ngram(const EST_String &name,EST_Ngrammar *n); diff -aur festival-orig/src/arch/festival/Phone.cc festival-patched/src/arch/festival/Phone.cc --- festival-orig/src/arch/festival/Phone.cc 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/arch/festival/Phone.cc 2006-12-12 17:08:52.000000000 +0100 @@ -43,6 +43,10 @@ #include "festival.h" #include "festivalP.h" +using std::cout; +using std::cerr; +using std::endl; + static void check_phoneset(void); static void ps_add_def(const EST_String &name, PhoneSet *ps); static LISP lisp_select_phoneset(LISP phoneset); diff -aur festival-orig/src/arch/festival/server.cc festival-patched/src/arch/festival/server.cc --- festival-orig/src/arch/festival/server.cc 2003-01-20 13:07:58.000000000 +0100 +++ festival-patched/src/arch/festival/server.cc 2006-12-12 17:08:52.000000000 +0100 @@ -54,6 +54,8 @@ #include "festival.h" #include "festivalP.h" +using namespace std; + #define DEFAULT_MAX_CLIENTS 10 /* The folloing gives a server that never forks */ diff -aur festival-orig/src/arch/festival/utterance.cc festival-patched/src/arch/festival/utterance.cc --- festival-orig/src/arch/festival/utterance.cc 2004-06-27 17:04:07.000000000 +0200 +++ festival-patched/src/arch/festival/utterance.cc 2006-12-12 17:08:52.000000000 +0100 @@ -42,6 +42,10 @@ #include "festival.h" #include "festivalP.h" +using std::cout; +using std::cerr; +using std::endl; + static LISP item_features(LISP sitem, LISP leval = NIL); static LISP item_features(EST_Item *s, bool evaluate_ff=false); static LISP stream_tree_to_lisp(EST_Item *s); diff -aur festival-orig/src/arch/festival/wagon_interp.cc festival-patched/src/arch/festival/wagon_interp.cc --- festival-orig/src/arch/festival/wagon_interp.cc 2003-01-14 19:21:07.000000000 +0100 +++ festival-patched/src/arch/festival/wagon_interp.cc 2006-12-12 17:08:52.000000000 +0100 @@ -155,8 +155,8 @@ return FALSE; else { - cerr << "Decision tree: unknown question operator: \"" << - str_oper << "\"\n"; + std::cerr << "Decision tree: unknown question operator: \"" << + str_oper << "\"" << std::endl; festival_error(); } return 0; diff -aur festival-orig/src/arch/festival/wave.cc festival-patched/src/arch/festival/wave.cc --- festival-orig/src/arch/festival/wave.cc 2006-12-12 16:41:28.000000000 +0100 +++ festival-patched/src/arch/festival/wave.cc 2006-12-12 17:08:52.000000000 +0100 @@ -47,6 +47,9 @@ #include "winsock2.h" #endif +using std::cerr; +using std::endl; + static void utt_save_f0_from_targets(EST_Utterance *u,EST_String &filename); static float f0_interpolate(EST_Item *ptval, EST_Item *tval, float time); diff -aur festival-orig/src/arch/festival/wfst.cc festival-patched/src/arch/festival/wfst.cc --- festival-orig/src/arch/festival/wfst.cc 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/arch/festival/wfst.cc 2006-12-12 17:08:52.000000000 +0100 @@ -40,6 +40,9 @@ #include "festival.h" #include "festivalP.h" +using std::cout; +using std::endl; + static LISP wfst_loaded_list = NIL; static EST_WFST *load_wfst(const EST_String &filename); static LISP add_wfst(const EST_String &name,EST_WFST *n); diff -aur festival-orig/src/include/festival.h festival-patched/src/include/festival.h --- festival-orig/src/include/festival.h 2003-07-21 14:46:49.000000000 +0200 +++ festival-patched/src/include/festival.h 2006-12-12 17:08:52.000000000 +0100 @@ -40,7 +40,7 @@ #define __FESTIVAL_H__ #include <stdlib.h> -#include <fstream.h> +#include <fstream> #include "EST.h" #include "EST_cutils.h" #include "siod.h" @@ -55,7 +55,7 @@ /* An iostream for outputing debug messages, switchable */ /* to /dev/null or cerr */ -extern ostream *cdebug; +extern std::ostream *cdebug; #define cwarn cout extern "C" FILE* stddebug; extern int ft_server_socket; diff -aur festival-orig/src/include/lexicon.h festival-patched/src/include/lexicon.h --- festival-orig/src/include/lexicon.h 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/include/lexicon.h 2006-12-12 17:08:52.000000000 +0100 @@ -99,12 +99,12 @@ const EST_String &word, int start,int mid, int end); - inline friend ostream& operator<<(ostream& s, Lexicon &p); + inline friend std::ostream& operator<<(std::ostream& s, Lexicon &p); Lexicon & operator =(const Lexicon &a); }; -inline ostream& operator<<(ostream& s, Lexicon &p) +inline std::ostream& operator<<(std::ostream& s, Lexicon &p) { s << "[LEXICON " << p.lex_name() << "]" ; return s; diff -aur festival-orig/src/include/ModuleDescription.h festival-patched/src/include/ModuleDescription.h --- festival-orig/src/include/ModuleDescription.h 2001-04-04 15:12:35.000000000 +0200 +++ festival-patched/src/include/ModuleDescription.h 2006-12-12 17:08:52.000000000 +0100 @@ -35,9 +35,11 @@ #define __MODULEDESCRIPTION_H__ #include <stdio.h> -#include <iostream.h> +#include <iostream> #include "EST_String.h" +using namespace std; + /** Machine readable descriptions of modules. Useful for help messages * and for verifying that a set of modules should work together. * @@ -130,7 +132,7 @@ /// Create a module description, initialising it properly. static struct ModuleDescription *create(); /// Print the description to the strream. - static ostream &print(ostream &s, const ModuleDescription &desc); + static std::ostream &print(ostream &s, const ModuleDescription &desc); static int print(FILE *s, const ModuleDescription &desc); diff -aur festival-orig/src/include/Phone.h festival-patched/src/include/Phone.h --- festival-orig/src/include/Phone.h 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/include/Phone.h 2006-12-12 17:08:52.000000000 +0100 @@ -55,12 +55,12 @@ { return features.val_def(key,def); } int match_features(Phone *foreign); - inline friend ostream& operator<<(ostream& s, Phone &p); + inline friend std::ostream& operator<<(std::ostream& s, Phone &p); Phone & operator =(const Phone &a); }; -inline ostream& operator<<(ostream& s, Phone &p) +inline std::ostream& operator<<(std::ostream& s, Phone &p) { s << "[PHONE " << p.phone_name() << "]"; // s << p.features << endl; @@ -108,13 +108,13 @@ != NIL); } void set_feature(const EST_String &name, LISP vals); - inline friend ostream& operator<<(ostream& s, PhoneSet &p); + inline friend std::ostream& operator<<(std::ostream& s, PhoneSet &p); Phone *find_matched_phone(Phone *phone); PhoneSet & operator =(const PhoneSet &a); }; -inline ostream& operator<<(ostream& s, PhoneSet &p) +inline std::ostream& operator<<(std::ostream& s, PhoneSet &p) { s << p.phone_set_name(); return s; } diff -aur festival-orig/src/main/audsp.cc festival-patched/src/main/audsp.cc --- festival-orig/src/main/audsp.cc 2001-06-04 14:44:56.000000000 +0200 +++ festival-patched/src/main/audsp.cc 2006-12-12 17:08:52.000000000 +0100 @@ -48,6 +48,9 @@ #include "EST.h" #include "EST_unix.h" +using std::cerr; +using std::endl; + #ifdef NO_SPOOLER int main(int argc, char **argv) diff -aur festival-orig/src/main/festival_client.cc festival-patched/src/main/festival_client.cc --- festival-orig/src/main/festival_client.cc 2004-04-30 18:56:52.000000000 +0200 +++ festival-patched/src/main/festival_client.cc 2006-12-12 17:08:52.000000000 +0100 @@ -48,6 +48,9 @@ typedef FILE *SERVER_FD; #endif +using std::cerr; +using std::endl; + static void festival_client_main(int argc, char **argv); static void copy_to_server(FILE *fdin,SERVER_FD serverfd); static void ttw_file(SERVER_FD serverfd, const EST_String &file); diff -aur festival-orig/src/main/festival_main.cc festival-patched/src/main/festival_main.cc --- festival-orig/src/main/festival_main.cc 2003-07-21 14:46:28.000000000 +0200 +++ festival-patched/src/main/festival_main.cc 2006-12-12 17:08:52.000000000 +0100 @@ -219,7 +225,7 @@ if (argc < 2) { - cerr << "festival: script_mode has no file to interpret" << endl; + std::cerr << "festival: script_mode has no file to interpret" << std::endl; return; } diff -aur festival-orig/src/modules/base/ff.cc festival-patched/src/modules/base/ff.cc --- festival-orig/src/modules/base/ff.cc 2004-04-30 18:56:51.000000000 +0200 +++ festival-patched/src/modules/base/ff.cc 2006-12-12 17:08:52.000000000 +0100 @@ -41,6 +41,9 @@ #include "festival.h" #include "modules.h" +using std::cerr; +using std::endl; + static EST_String stressname("stress"); static EST_Val val_string0("0"); static EST_Val val_string1("1"); diff -aur festival-orig/src/modules/base/modules.cc festival-patched/src/modules/base/modules.cc --- festival-orig/src/modules/base/modules.cc 2004-06-21 22:52:43.000000000 +0200 +++ festival-patched/src/modules/base/modules.cc 2006-12-12 17:08:52.000000000 +0100 @@ -43,6 +43,9 @@ #include "modules.h" #include "intonation.h" +using std::cerr; +using std::endl; + static void create_words(EST_Utterance *u); static void create_segments(EST_Utterance *u); static void create_wave(EST_Utterance *u); diff -aur festival-orig/src/modules/base/parameters.cc festival-patched/src/modules/base/parameters.cc --- festival-orig/src/modules/base/parameters.cc 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/modules/base/parameters.cc 2006-12-12 17:08:52.000000000 +0100 @@ -45,6 +45,8 @@ // this isn't as efficient as it might be, but we aren't going to be // doing this inside any loops +using std::cerr; + LISP lisp_parameter_get(const EST_String parameter_name) { LISP parameter_get = siod_get_lval("Parameter.get", "Parameter.get not defined"); diff -aur festival-orig/src/modules/base/phrasify.cc festival-patched/src/modules/base/phrasify.cc --- festival-orig/src/modules/base/phrasify.cc 2004-05-03 21:26:15.000000000 +0200 +++ festival-patched/src/modules/base/phrasify.cc 2006-12-12 17:08:52.000000000 +0100 @@ -41,6 +41,9 @@ #include "festival.h" #include "modules.h" +using std::cerr; +using std::endl; + static void phrasing_none(EST_Utterance *u); static void phrasing_by_cart(EST_Utterance *u); static void phrasing_by_probmodels(EST_Utterance *u); diff -aur festival-orig/src/modules/base/phrinfo.cc festival-patched/src/modules/base/phrinfo.cc --- festival-orig/src/modules/base/phrinfo.cc 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/modules/base/phrinfo.cc 2006-12-12 17:08:52.000000000 +0100 @@ -43,6 +43,9 @@ #include "modules.h" #include "text.h" +using std::cerr; +using std::endl; + static EST_Item *make_phrase_node(EST_Utterance *u, const EST_String &name, LISP feats); diff -aur festival-orig/src/modules/base/pos.cc festival-patched/src/modules/base/pos.cc --- festival-orig/src/modules/base/pos.cc 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/modules/base/pos.cc 2006-12-12 17:08:52.000000000 +0100 @@ -41,6 +41,9 @@ #include "festival.h" #include "lexicon.h" +using std::cerr; +using std::endl; + static EST_VTCandidate *pos_candlist(EST_Item *s,EST_Features &f); static EST_VTPath *pos_npath(EST_VTPath *p,EST_VTCandidate *c,EST_Features &f); static double find_np_prob(EST_VTPath *p,int n,int *state); diff -aur festival-orig/src/modules/base/word.cc festival-patched/src/modules/base/word.cc --- festival-orig/src/modules/base/word.cc 2004-06-21 22:52:43.000000000 +0200 +++ festival-patched/src/modules/base/word.cc 2006-12-12 17:27:28.000000000 +0100 @@ -42,6 +42,9 @@ #include "lexicon.h" #include "modules.h" +using std::cerr; +using std::endl; + static EST_Item *add_syllable(EST_Utterance *u, int stress); static LISP specified_word_pronunciation(EST_Item *w, LISP lpos); @@ -113,10 +116,10 @@ for (w=u->relation("Word")->first(); w != 0; w = next(w)) { lpos = NIL; - pos = string(ffeature(w,"hg_pos")); + pos = (EST_String)ffeature(w,"hg_pos"); // explicit homograph pos disambiguation if (pos == "0") - pos = string(ffeature(w,"pos")); + pos = (EST_String)ffeature(w,"hg_pos"); if (pos != "0") lpos = rintern(pos); diff -aur festival-orig/src/modules/clunits/acost.cc festival-patched/src/modules/clunits/acost.cc --- festival-orig/src/modules/clunits/acost.cc 2001-08-06 19:34:03.000000000 +0200 +++ festival-patched/src/modules/clunits/acost.cc 2006-12-12 17:08:52.000000000 +0100 @@ -49,6 +49,8 @@ #include "festival.h" #include "clunits.h" +using namespace std; + static void find_unit_distances(LISP units, const EST_String &fname); static float duration_penalty_weight=1.0; diff -aur festival-orig/src/modules/clunits/cldb.cc festival-patched/src/modules/clunits/cldb.cc --- festival-orig/src/modules/clunits/cldb.cc 2004-01-31 01:04:02.000000000 +0100 +++ festival-patched/src/modules/clunits/cldb.cc 2006-12-12 17:08:52.000000000 +0100 @@ -44,6 +44,8 @@ #include "EST_FileType.h" #include "clunits.h" +using namespace std; + VAL_REGISTER_CLASS(clunitsdb,CLDB) SIOD_REGISTER_CLASS(clunitsdb,CLDB) static void cl_load_catalogue(CLDB *cldb,EST_String &indexfile); diff -aur festival-orig/src/modules/clunits/clunits.cc festival-patched/src/modules/clunits/clunits.cc --- festival-orig/src/modules/clunits/clunits.cc 2004-05-25 15:06:04.000000000 +0200 +++ festival-patched/src/modules/clunits/clunits.cc 2006-12-12 17:08:52.000000000 +0100 @@ -84,6 +84,9 @@ static EST_String static_tscore = "local_target_cost"; static EST_String static_cscore = "cummulative_unit_score"; +using std::cerr; +using std::endl; + static void setup_clunits_params(); static EST_VTCandidate *TS_candlist(EST_Item *s,EST_Features &f); static EST_VTPath *TS_npath(EST_VTPath *p,EST_VTCandidate *c,EST_Features &f); diff -aur festival-orig/src/modules/clunits/clunits.h festival-patched/src/modules/clunits/clunits.h --- festival-orig/src/modules/clunits/clunits.h 2001-07-05 14:19:09.000000000 +0200 +++ festival-patched/src/modules/clunits/clunits.h 2006-12-12 17:08:52.000000000 +0100 @@ -83,9 +83,9 @@ CLfile *get_fileitem(const EST_String &name) { return (CLfile *)fileindex.lookup(name); } void load_coefs_sig(EST_Item *unit); - CLfile *CLDB::get_file_coefs_sig(const EST_String &fileid); + CLfile *get_file_coefs_sig(const EST_String &fileid); void load_join_coefs(CLunit *unit); - CLfile *CLDB::get_file_join_coefs(const EST_String &fileid); + CLfile *get_file_join_coefs(const EST_String &fileid); }; diff -aur festival-orig/src/modules/diphone/di_io.cc festival-patched/src/modules/diphone/di_io.cc --- festival-orig/src/modules/diphone/di_io.cc 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/modules/diphone/di_io.cc 2006-12-12 17:08:52.000000000 +0100 @@ -415,6 +415,16 @@ ulaw_to_short(ulaw,db->vox[i]->signal,db->vox[i]->nsamples); wfree(ulaw); } + else if (db->group_encoding == di_alaw) + { + unsigned char *alaw = + walloc(unsigned char,db->vox[i]->nsamples); + db->vox[i]->signal = walloc(short,db->vox[i]->nsamples); + fseek(db->gfd,db->gsignalbase+(db->offsets[i]),SEEK_SET); + fread(alaw,sizeof(unsigned char),db->vox[i]->nsamples,db->gfd); + alaw_to_short(alaw,db->vox[i]->signal,db->vox[i]->nsamples); + wfree(alaw); + } else { cerr << "Diphone: unknown group type" << endl; @@ -800,8 +810,13 @@ } else if (db->group_encoding == di_ulaw) { - db->allulawsignal = walloc(unsigned char,totsamples); - fread(db->allulawsignal,sizeof(unsigned char),totsamples,db->gfd); + db->allualawsignal = walloc(unsigned char,totsamples); + fread(db->allualawsignal,sizeof(unsigned char),totsamples,db->gfd); + } + else if (db->group_encoding == di_alaw) + { + db->allualawsignal = walloc(unsigned char,totsamples); + fread(db->allualawsignal,sizeof(unsigned char),totsamples,db->gfd); } } else @@ -821,7 +836,13 @@ else if (db->group_encoding == di_ulaw) { db->vox[i]->signal = walloc(short,samp_counts[i]); - ulaw_to_short(&db->allulawsignal[sample_offset], + ulaw_to_short(&db->allualawsignal[sample_offset], + db->vox[i]->signal,samp_counts[i]); + } + else if (db->group_encoding == di_alaw) + { + db->vox[i]->signal = walloc(short,samp_counts[i]); + alaw_to_short(&db->allualawsignal[sample_offset], db->vox[i]->signal,samp_counts[i]); } else @@ -838,7 +859,7 @@ sample_offset += samp_counts[i]; } if (db->sig_access_type != di_direct) - if (db->group_encoding == di_ulaw) + if (db->group_encoding == di_ulaw || db->group_encoding == di_alaw) fseek(db->gfd,(long)sample_offset,SEEK_CUR); else fseek(db->gfd,(long)sample_offset*sizeof(short),SEEK_CUR); @@ -867,7 +888,7 @@ if (db->swap) swap_bytes_float(db->allframes,totframes*db->lpc_order); } - else if (db->group_encoding == di_ulaw) // its as shorts + else if (db->group_encoding == di_ulaw || db->group_encoding == di_alaw) // its as shorts { db->allframesshort = walloc(short,totframes*db->lpc_order); fread(db->allframesshort,sizeof(short), @@ -885,7 +906,7 @@ for (j=0;j<db->lpc[i]->nframes;j++) db->lpc[i]->f[j] = &db->allframes[(frame_offset+j)*db->lpc_order]; - else if (db->group_encoding == di_ulaw) + else if (db->group_encoding == di_ulaw || db->group_encoding == di_alaw) { int fixedpoint = FALSE; if (siod_get_lval("lpc_fixedpoint",NULL) != NIL) @@ -1031,6 +1052,13 @@ fwrite(ulaw,sizeof(unsigned char),db->vox[i]->nsamples,fd); wfree(ulaw); } + else if (db->group_encoding == di_alaw) + { + unsigned char *alaw = walloc(unsigned char,db->vox[i]->nsamples); + short_to_alaw(db->vox[i]->signal,alaw,db->vox[i]->nsamples); + fwrite(alaw,sizeof(unsigned char),db->vox[i]->nsamples,fd); + wfree(alaw); + } else { cerr << "Diphone: unknown group type for dumping" << endl; @@ -1058,7 +1086,7 @@ for (j=0; j<db->lpc[i]->nframes; j++) fwrite(db->lpc[i]->f[j],sizeof(float),db->lpc_order,fd); } - else if (db->group_encoding == di_ulaw) // saved as shorts + else if (db->group_encoding == di_ulaw || db->group_encoding == di_alaw) // saved as shorts { short *sh = new short[db->lpc_order]; diff -aur festival-orig/src/modules/diphone/diphone.cc festival-patched/src/modules/diphone/diphone.cc --- festival-orig/src/modules/diphone/diphone.cc 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/modules/diphone/diphone.cc 2006-12-12 17:08:52.000000000 +0100 @@ -38,12 +38,14 @@ /* standard CSTR diphone dbs */ /* */ /*=======================================================================*/ -#include <iostream.h> -#include <fstream.h> +#include <iostream> +#include <fstream> #include "festival.h" #include "ModuleDescription.h" #include "diphone.h" +using namespace std; + static ModuleDescription di_description = { "diphone", 1.0, @@ -180,6 +182,8 @@ db->group_encoding = di_raw; else if (streq(db->group_encoding_str,"ulaw")) db->group_encoding = di_ulaw; + else if (streq(db->group_encoding_str,"alaw")) + db->group_encoding = di_alaw; else { cerr << "Diphone: unknown group encoding" << endl; @@ -218,7 +222,7 @@ { wfree(db->indx[0]->diph); // ptr to the whole diphname table wfree(db->allsignal); - wfree(db->allulawsignal); + wfree(db->allualawsignal); wfree(db->allframes); } for (i=0; i < db->nindex; i++) @@ -275,7 +279,7 @@ db->alternates_before = NIL; db->alternates_after = NIL; db->allsignal = 0; - db->allulawsignal = 0; + db->allualawsignal = 0; db->offsets = 0; db->gfd = 0; db->default_diphone = 0; diff -aur festival-orig/src/modules/diphone/diphone.h festival-patched/src/modules/diphone/diphone.h --- festival-orig/src/modules/diphone/diphone.h 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/modules/diphone/diphone.h 2006-12-12 17:08:52.000000000 +0100 @@ -41,7 +41,7 @@ enum di_sigaccess_t {di_direct, di_dynamic, di_ondemand}; enum di_db_type_t {di_pcm, di_lpc}; -enum di_group_encode_t {di_raw, di_ulaw }; +enum di_group_encode_t {di_raw, di_ulaw, di_alaw }; enum di_group_t {di_grouped, di_ungrouped}; typedef struct { @@ -109,7 +109,7 @@ int lpc_pitch_synch; /* True if lpc frames are pitch synchronous */ short *allsignal; /* used in group files */ - unsigned char *allulawsignal; + unsigned char *allualawsignal; float *allframes; short *allframesshort; diff -aur festival-orig/src/modules/diphone/oc.cc festival-patched/src/modules/diphone/oc.cc --- festival-orig/src/modules/diphone/oc.cc 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/modules/diphone/oc.cc 2006-12-12 17:08:52.000000000 +0100 @@ -39,9 +39,11 @@ /* distance between two vectors). */ /* */ /*=======================================================================*/ -#include <iostream.h> +#include <iostream> #include "festival.h" +using namespace std; + #define LEFT_PHONE(x) (car(x)) #define RIGHT_PHONE(x) (car(cdr(x))) #define FILEID(x) (car(cdr(cdr(x)))) diff -aur festival-orig/src/modules/donovan/donovan.cc festival-patched/src/modules/donovan/donovan.cc --- festival-orig/src/modules/donovan/donovan.cc 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/modules/donovan/donovan.cc 2006-12-12 17:08:52.000000000 +0100 @@ -44,11 +44,13 @@ /* Note the FreeSpeech code is GNU Copyright not like the above */ /* */ /*=======================================================================*/ -#include <iostream.h> -#include <fstream.h> +#include <iostream> +#include <fstream> #include "festival.h" #include "donovan.h" +using namespace std; + static CONFIG *make_config(void); static void delete_config(CONFIG *config); static SPN *make_spn(EST_Utterance &u); @@ -111,7 +113,7 @@ if (nindex == 0) { - cerr << "Festival: no donovan diphones loaded\n"; + cerr << "Festival: no donovan diphones loaded" << endl; festival_error(); } @@ -307,7 +309,7 @@ (void)npp; (void)as; - cerr << "Donovan diphones: as_realloc called unexpectedly\n"; + cerr << "Donovan diphones: as_realloc called unexpectedly" << endl; festival_error(); } diff -aur festival-orig/src/modules/donovan/t2s.h festival-patched/src/modules/donovan/t2s.h --- festival-orig/src/modules/donovan/t2s.h 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/modules/donovan/t2s.h 2006-12-12 17:08:52.000000000 +0100 @@ -261,10 +261,6 @@ /* transcribe.c */ void transcribe(CONFIG *config, LING_LIST *ling_list); -/* ulaw.c */ -unsigned char linear2ulaw(int sample); -int ulaw2linear(unsigned char ulawbyte); - /* utils.c */ char **split(char *in); void tidy_split(char **root); diff -aur festival-orig/src/modules/Duration/duration.cc festival-patched/src/modules/Duration/duration.cc --- festival-orig/src/modules/Duration/duration.cc 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/modules/Duration/duration.cc 2006-12-12 17:08:52.000000000 +0100 @@ -41,6 +41,8 @@ #include "festival.h" #include "durationP.h" +using namespace std; + LISP FT_Duration_Ave_Utt(LISP utt) { // Predict average duration on segments diff -aur festival-orig/src/modules/Duration/dur_aux.cc festival-patched/src/modules/Duration/dur_aux.cc --- festival-orig/src/modules/Duration/dur_aux.cc 2004-06-21 16:03:34.000000000 +0200 +++ festival-patched/src/modules/Duration/dur_aux.cc 2006-12-12 17:08:52.000000000 +0100 @@ -41,6 +41,8 @@ #include "festival.h" #include "durationP.h" +using std::cerr; + float dur_get_stretch(void) { LISP lstretch = ft_get_param("Duration_Stretch"); diff -aur festival-orig/src/modules/Duration/Klatt.cc festival-patched/src/modules/Duration/Klatt.cc --- festival-orig/src/modules/Duration/Klatt.cc 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/modules/Duration/Klatt.cc 2006-12-12 17:08:52.000000000 +0100 @@ -56,6 +56,10 @@ #include "festival.h" #include "durationP.h" +using std::cout; +using std::cerr; +using std::endl; + static void klatt_dur_debug(EST_Item *s); static float rule2(EST_Item *seg); diff -aur festival-orig/src/modules/Intonation/duffint.cc festival-patched/src/modules/Intonation/duffint.cc --- festival-orig/src/modules/Intonation/duffint.cc 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/modules/Intonation/duffint.cc 2006-12-12 17:08:52.000000000 +0100 @@ -41,6 +41,9 @@ #include "festival.h" #include "intonation.h" +using std::cout; +using std::endl; + LISP FT_Intonation_Default_Utt(LISP utt) { return utt; diff -aur festival-orig/src/modules/Intonation/gen_int.cc festival-patched/src/modules/Intonation/gen_int.cc --- festival-orig/src/modules/Intonation/gen_int.cc 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/modules/Intonation/gen_int.cc 2006-12-12 17:08:52.000000000 +0100 @@ -49,6 +49,9 @@ #include "festival.h" #include "intonation.h" +using std::cerr; +using std::endl; + static void check_targs(EST_Utterance *u); static EST_Item *find_nearest_seg(EST_Utterance *u,float pos); diff -aur festival-orig/src/modules/Intonation/int_tree.cc festival-patched/src/modules/Intonation/int_tree.cc --- festival-orig/src/modules/Intonation/int_tree.cc 2004-06-21 22:52:43.000000000 +0200 +++ festival-patched/src/modules/Intonation/int_tree.cc 2006-12-12 17:08:52.000000000 +0100 @@ -367,7 +367,7 @@ add_target(u,seg,seg->F("end"),val); else { - cerr << "add_target_at: unknown position type\n"; + cerr << "add_target_at: unknown position type" << endl; festival_error(); } } diff -aur festival-orig/src/modules/Intonation/simple.cc festival-patched/src/modules/Intonation/simple.cc --- festival-orig/src/modules/Intonation/simple.cc 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/modules/Intonation/simple.cc 2006-12-12 17:08:52.000000000 +0100 @@ -52,7 +52,7 @@ LISP accent_tree; EST_Val paccent; - *cdebug << "Simple intonation module" << endl; + *cdebug << "Simple intonation module" << std::endl; accent_tree = siod_get_lval("int_accent_cart_tree","no accent tree"); @@ -80,7 +80,7 @@ LISP simple_params; float f0_mean, f0_std; - *cdebug << "Simple int targets module" << endl; + *cdebug << "Simple int targets module" << std::endl; // Create some down step accents simple_params = siod_get_lval("int_simple_params","no simple params"); diff -aur festival-orig/src/modules/Lexicon/complex.cc festival-patched/src/modules/Lexicon/complex.cc --- festival-orig/src/modules/Lexicon/complex.cc 2004-06-21 22:52:43.000000000 +0200 +++ festival-patched/src/modules/Lexicon/complex.cc 2006-12-12 17:08:52.000000000 +0100 @@ -44,6 +44,8 @@ #include "lexiconP.h" #include "lts.h" +using namespace std; + static LISP check_and_fix(LISP entry); static void check_sylphones(const char *name,LISP syls); diff -aur festival-orig/src/modules/Lexicon/lexicon.cc festival-patched/src/modules/Lexicon/lexicon.cc --- festival-orig/src/modules/Lexicon/lexicon.cc 2002-01-29 13:47:03.000000000 +0100 +++ festival-patched/src/modules/Lexicon/lexicon.cc 2006-12-12 17:08:52.000000000 +0100 @@ -43,6 +43,10 @@ #include "lexiconP.h" #include "lts.h" +using std::cout; +using std::cerr; +using std::endl; + static int bl_match_entry(LISP entry,const EST_String &word); static int match_features(LISP req_feats, LISP act_feats); diff -aur festival-orig/src/modules/Lexicon/lts_rules.cc festival-patched/src/modules/Lexicon/lts_rules.cc --- festival-orig/src/modules/Lexicon/lts_rules.cc 2003-01-09 16:43:28.000000000 +0100 +++ festival-patched/src/modules/Lexicon/lts_rules.cc 2006-12-12 17:08:52.000000000 +0100 @@ -58,6 +58,8 @@ #include "festival.h" #include "lts.h" +using namespace std; + class LTS_Ruleset{ private: EST_String p_name; diff -aur festival-orig/src/modules/rxp/ttsxml.cc festival-patched/src/modules/rxp/ttsxml.cc --- festival-orig/src/modules/rxp/ttsxml.cc 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/modules/rxp/ttsxml.cc 2006-12-12 17:08:52.000000000 +0100 @@ -46,6 +46,9 @@ #include "text.h" #include "rxp.h" +using std::cerr; +using std::endl; + // So we can share the known_ids table. #include "ling_class/EST_utterance_xml.h" diff -aur festival-orig/src/modules/Text/text.cc festival-patched/src/modules/Text/text.cc --- festival-orig/src/modules/Text/text.cc 2004-04-30 18:56:51.000000000 +0200 +++ festival-patched/src/modules/Text/text.cc 2006-12-12 17:08:52.000000000 +0100 @@ -49,6 +49,9 @@ #include "festival.h" #include "text.h" +using std::cerr; +using std::endl; + static void tts_raw_token(EST_Item *t); static void tts_raw_utt(LISP utt); diff -aur festival-orig/src/modules/Text/text_modes.cc festival-patched/src/modules/Text/text_modes.cc --- festival-orig/src/modules/Text/text_modes.cc 2003-08-29 12:23:24.000000000 +0200 +++ festival-patched/src/modules/Text/text_modes.cc 2006-12-12 17:08:52.000000000 +0100 @@ -52,6 +52,9 @@ #include "text.h" #include "lexicon.h" +using std::cerr; +using std::endl; + static void um_apply_filter(const EST_String &filtername, const EST_String &infile, const EST_String &outname); diff -aur festival-orig/src/modules/Text/token.cc festival-patched/src/modules/Text/token.cc --- festival-orig/src/modules/Text/token.cc 2004-05-03 21:27:16.000000000 +0200 +++ festival-patched/src/modules/Text/token.cc 2006-12-12 17:08:52.000000000 +0100 @@ -84,7 +84,7 @@ LISP FT_Spanish_Token_Utt(LISP utt) { (void)utt; - cerr << "TOKEN: Spanish tokenization not yet supported\n"; + std::cerr << "TOKEN: Spanish tokenization not yet supported" << std::endl; festival_error(); // never happens @@ -136,7 +136,7 @@ LISP words,w,eou_tree,l; EST_Item *new_word; - *cdebug << "Token module (English)" << endl; + *cdebug << "Token module (English)" << std::endl; eou_tree = siod_get_lval("eou_tree","No end of utterance tree"); user_token_to_word_func = siod_get_lval("token_to_words",NULL); @@ -404,7 +404,7 @@ const char *tokch = tok; for (i=0; i<tok.length(); i++) - if (strchr(PunctuationChars,tokch[i]) == NULL) + if (::strchr(PunctuationChars,tokch[i]) == NULL) return FALSE; return TRUE; @@ -471,7 +471,7 @@ { // I don't think I've forgotten anything *cdebug << "Token: can't make ordinal from \"" << lastword - << "\"" << endl; + << "\"" << std::endl; CAR(last) = strintern(EST_String(lastword)+"th"); } diff -aur festival-orig/src/modules/Text/tok_ext.cc festival-patched/src/modules/Text/tok_ext.cc --- festival-orig/src/modules/Text/tok_ext.cc 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/modules/Text/tok_ext.cc 2006-12-12 17:08:52.000000000 +0100 @@ -48,6 +48,9 @@ #include "lexicon.h" #include "text.h" +using std::cerr; +using std::endl; + static int rhc = 10; static int lhc = 10; diff -aur festival-orig/src/modules/Text/xxml.cc festival-patched/src/modules/Text/xxml.cc --- festival-orig/src/modules/Text/xxml.cc 2003-08-03 23:25:55.000000000 +0200 +++ festival-patched/src/modules/Text/xxml.cc 2006-12-12 17:08:52.000000000 +0100 @@ -48,6 +48,9 @@ #include "text.h" #include "lexicon.h" +using std::cerr; +using std::endl; + static LISP xxml_get_attribute(const EST_String &remainder); static char *xxml_process_line(const char *line); static void tts_xxml_token(EST_Item *t); diff -aur festival-orig/src/modules/UniSyn/us_features.cc festival-patched/src/modules/UniSyn/us_features.cc --- festival-orig/src/modules/UniSyn/us_features.cc 2001-04-04 13:55:20.000000000 +0200 +++ festival-patched/src/modules/UniSyn/us_features.cc 2006-12-12 17:08:52.000000000 +0100 @@ -43,6 +43,9 @@ #include "EST_error.h" #include "us_features.h" +using std::cerr; +using std::endl; + void add_feature_function(EST_Relation &r, const EST_String &fname, const EST_String &funcname) { diff -aur festival-orig/src/modules/UniSyn_diphone/UniSyn_diphone.cc festival-patched/src/modules/UniSyn_diphone/UniSyn_diphone.cc --- festival-orig/src/modules/UniSyn_diphone/UniSyn_diphone.cc 2003-12-03 12:54:19.000000000 +0100 +++ festival-patched/src/modules/UniSyn_diphone/UniSyn_diphone.cc 2006-12-12 17:08:52.000000000 +0100 @@ -42,6 +42,8 @@ #include "us_diphone.h" #include "festival.h" +using std::endl; + extern USDiphIndex *diph_index; LISP us_dbs = NIL; LISP us_make_group_file(LISP lname, LISP params); @@ -114,7 +116,7 @@ d_index->grouped = true; if (d_index->ts.open(d_index->index_file) != 0) { - cerr << "US DB: can't open grouped diphone file " + std::cerr << "US DB: can't open grouped diphone file " << d_index->index_file << endl; festival_error(); } @@ -123,10 +125,10 @@ } else { - *cdebug << ":" << get_param_str("grouped",args,"") << ":" << endl; - *cdebug << "index grouped:" << d_index->grouped << endl; - *cdebug << "true:" << true << endl; - *cdebug << "false:" << false << endl; + *cdebug << ":" << get_param_str("grouped",args,"") << ":" << endl + << "index grouped:" << d_index->grouped << endl + << "true:" << true << endl + << "false:" << false << endl; d_index->coef_dir = get_param_str("coef_dir",args,""); d_index->sig_dir = get_param_str("sig_dir",args,""); diff -aur festival-orig/src/modules/UniSyn_diphone/us_diphone_index.cc festival-patched/src/modules/UniSyn_diphone/us_diphone_index.cc --- festival-orig/src/modules/UniSyn_diphone/us_diphone_index.cc 2004-06-21 22:52:43.000000000 +0200 +++ festival-patched/src/modules/UniSyn_diphone/us_diphone_index.cc 2006-12-12 17:08:52.000000000 +0100 @@ -43,6 +43,10 @@ #include "us_diphone.h" #include "Phone.h" +using std::cout; +using std::cerr; +using std::endl; + static bool US_full_coefs = false; USDiphIndex *diph_index = 0; extern LISP us_dbs; diff -aur festival-orig/src/modules/UniSyn_diphone/us_diphone_unit.cc festival-patched/src/modules/UniSyn_diphone/us_diphone_unit.cc --- festival-orig/src/modules/UniSyn_diphone/us_diphone_unit.cc 2004-06-21 22:52:43.000000000 +0200 +++ festival-patched/src/modules/UniSyn_diphone/us_diphone_unit.cc 2006-12-12 17:08:52.000000000 +0100 @@ -43,6 +43,9 @@ #include "us_diphone.h" #include "Phone.h" +using std::cerr; +using std::endl; + extern USDiphIndex *diph_index; void dur_to_end(EST_Relation &r) diff -aur festival-orig/src/modules/UniSyn_phonology/UniSyn_build.cc festival-patched/src/modules/UniSyn_phonology/UniSyn_build.cc --- festival-orig/src/modules/UniSyn_phonology/UniSyn_build.cc 2001-07-24 15:08:48.000000000 +0200 +++ festival-patched/src/modules/UniSyn_phonology/UniSyn_build.cc 2006-12-12 17:08:52.000000000 +0100 @@ -41,9 +41,11 @@ #include <stdio.h> #include <stdlib.h> #include <math.h> -#include <fstream.h> +#include <fstream> #include "festival.h" +using namespace std; + #include "../UniSyn/us_features.h" void merge_features(EST_Item *from, EST_Item *to, int keep_id);