diff --git a/dictsource/dict_phonemes b/dictsource/dict_phonemes index c2bd0274..e2913ac4 100644 --- a/dictsource/dict_phonemes +++ b/dictsource/dict_phonemes @@ -340,8 +340,8 @@ Dictionary zh_dict i i. i[ iou o o- ou u uai y -: f j k kh l m n -N p ph R R2 R3 s s. +: f h j k kh l m +n N p ph r R s s. S; t th ts ts. ts. tS; tS; tsh v w x z z. @@ -370,7 +370,6 @@ Dictionary hbs_dict & @ @2 a A a: aI aU E e e: i I i: l- O o o: oU r* r- u U u: -y * b d dZ dZ; f g h j k l L l^ m n N diff --git a/dictsource/es_list b/dictsource/es_list index 8aaff08f..6d6dda8b 100644 --- a/dictsource/es_list +++ b/dictsource/es_list @@ -298,6 +298,7 @@ _. punto // pronunciation exceptions +linux $1 méxico mExiko mexicano mExikano diff --git a/dictsource/es_rules b/dictsource/es_rules index 13cdf822..e65f55e7 100644 --- a/dictsource/es_rules +++ b/dictsource/es_rules @@ -69,7 +69,7 @@ .group i _) i (_ i i i - i (A j + i (A J^ l) i (A %i r) i (A %i @@ -109,7 +109,7 @@ .group o _) o (_ o o o - oy oI + oy (K oI oy (_ 'oI @@ -170,8 +170,8 @@ .group x _) x (_ Ekis x ks - A) x (A ks - x (_ =ks + A) x (A Qs + x (_ =Qs .group y @@ -181,7 +181,7 @@ _m) y J _n) y J _l) y J - y (A j + y (A J^ .group z diff --git a/dictsource/fr_list b/dictsource/fr_list index 29fc6729..382594ae 100755 --- a/dictsource/fr_list +++ b/dictsource/fr_list @@ -25,9 +25,9 @@ _à a:aksA~gRav ñ Entilde ô o:aksA~siRkO~flEks ö o:tRema -ù u:aksA~gRav -û u:aksA~siRkO~flEks -ü u:tRema +ù y:aksA~gRav +û y:aksA~siRkO~flEks +ü y:tRema _y i:gR'Ek @@ -293,7 +293,7 @@ durant $brk ne $u $verbf // questions -où $pause +où $brk // auxillary verbs (be, have, can, etc) suis $u+ $verb @@ -415,7 +415,6 @@ t'y ti (nord est) nOREst écho Eko cci $abbrev -espeak ispik nvda $abbrev open Op'En outlook autluk @@ -452,6 +451,7 @@ fret fR'Et gadget gadZEt hamlet amlEt internet E~tERnEt +(internet explorer) E~tErn'Et||EksplOr'Wr jacket ZakEt knesset knEsEt lazaret lazaREt @@ -528,6 +528,13 @@ viavoice viavOjs windows windoz word wORd wright _^_EN +update @pd'ejt +skype sk'ajp@- +bluetooth blut'us +messenger mEsE~nZ'Wr +player plEj'Wr +movy muv'i +maker mEjk'Wr yacht jot @@ -602,3 +609,4 @@ vincent vE~sA~ + diff --git a/dictsource/fr_rules b/dictsource/fr_rules index b78eb466..ae2e3c08 100755 --- a/dictsource/fr_rules +++ b/dictsource/fr_rules @@ -39,6 +39,8 @@ aoû u // août au (l_ O // Paul au o // autruche + aud (_ o // chaud + au o // autruche p) ay (s Ei // pays paysage ay (C E // aymé ay Ej // paye @@ -174,7 +176,7 @@ lum) en (t_ A~ rum) en (t_ A~ // prudemment - _cli) en (t_ A~ // client + _cli) en (t A~ // client _laur) en (t_ A~ _mécont) en (t_ A~ _cont) en (t_ A~ @@ -217,7 +219,6 @@ w) er (s_ WR er (_ e // parler léger - er (_A eR // parler léger er (s_ e i) ert (_t2 e // requiert @@ -477,6 +478,7 @@ _) ok (_ oke // OK o (mm O // comme dr) o (me_ o // vélodrome + ph) o (ne_ O // téléphone om (b O~ // bombe om (p O~ // pompe n) om (_ O~ // nom @@ -486,10 +488,10 @@ onsh (A O~z // bonshommes onh (A On // bonhomme - b) on (_A On // liaison: bon élève - m) on (_A O~n // mon appui - s) on (_A O~n - t) on (_A O~n + _b) on (_A On // liaison: bon élève + _m) on (_A O~n // mon appui + _s) on (_A O~n + _t) on (_A O~n z) o (ne_ o // amazone c) o (ne_ o @@ -561,7 +563,8 @@ _) q (_ ky q k // coq qu k // quatre - que (_ k@ // puisque + _) que (_ k@ // que + que (_ k@- // puisque banque... _) qu' (P3 k // qu'il n) q (_ k // cinq cent @@ -570,7 +573,7 @@ right _^_EN // copyright _su) rr RR // surréaliste ou) rr RR // courrai - rre (_ R // barre + rre (_ R@- // barre rr R // erreur r r // rien @@ -627,10 +630,12 @@ .group t _) t (_ te t t // bataille - t (_ t2 // silent at end of word unless next word starts with a vowel +V) t (_ t2 // silent at end of verb unless next word starts with a vowel + t (_ // silent at end of word ts (_S1 z2 // silent at end of word unless next word starts with a vowel C) t (_ t // compost watt soft script malttact abrupt - n) t (_ t2 // emprunt + Vn) t (_ t2 // silent at end of verb unless next word starts with a vowel + n) t (_ // silent at end of word r) t (_ t2 // fort aul) t (_ // Renault @@ -796,3 +801,4 @@ © _^_EN ® R@ZistR'@d_m'aRk + diff --git a/dictsource/jbo_list b/dictsource/jbo_list index ada2f706..e248f0e0 100644 --- a/dictsource/jbo_list +++ b/dictsource/jbo_list @@ -43,31 +43,10 @@ w v@bu +// unstressed words. Note single-syllable cmavo are all unstressed in jbo_rules e'o $u+ // request -xu $u+ // question - -pu $u+ // past - -ko $u+ -ku $u+ -cu $u+ -se $u+ -te $u+ - -la $u+ // article -le $u+ -li $u+ -lo $u+ - -pe $u+ // of -po $u+ -po'e $u+ - -fa $u+ -fe $u+ -fi $u+ -fo $u+ -fu $u+ +po'e $u+ // of +zo'e $u+ // pronoun i $u+ $pause @@ -77,11 +56,4 @@ ku ku_: boi bOI_: vau vaU_: kei keI_: - -// pronouns -mi $u+ -do $u+ -ti $u+ -ta $u+ -tu $u+ -zo'e $u+ +toi tOI_: diff --git a/dictsource/jbo_rules b/dictsource/jbo_rules index 5350e169..d57415ee 100644 --- a/dictsource/jbo_rules +++ b/dictsource/jbo_rules @@ -7,6 +7,9 @@ a a ai aI au aU + X) a (_ %a // single-syllable cmavo are unstressed + X) ai (_ %aI + X) au (_ %aU .group b b b @@ -21,6 +24,8 @@ .group e e e ei eI + X) e (_ %e + X) ei (_ %eI .group f f f @@ -34,6 +39,8 @@ .group i i i i (A j + X) i (_ %i + X) i (A_ %j .group j j Z @@ -57,6 +64,8 @@ .group o o o oi OI + X) o (_ %o + X) oi (_ %OI .group p p p @@ -80,6 +89,8 @@ .group u u u u (A w + X) u (_ %u + X) u (A_ %w .group v v v diff --git a/dictsource/no_list b/dictsource/no_list index 5ab2ff80..90186aff 100755 --- a/dictsource/no_list +++ b/dictsource/no_list @@ -257,5 +257,5 @@ i i: $atend der dE:r her hE:r kom kOm -noe nu:@2 // ?? +loe lu: $capital system syst'e:m diff --git a/dictsource/no_rules b/dictsource/no_rules index 160d682f..f5476f3d 100644 --- a/dictsource/no_rules +++ b/dictsource/no_rules @@ -110,13 +110,12 @@ o (CC O oi OI - oe Y: // ø - oe (CC W - oey Yy + oe O@2 + @b) oe (_ u: o (nd U o (rt U - o (rd u: // ?? or just for "bord" ? + b) o (rd u: o (st U .group p @@ -186,6 +185,7 @@ .group å å o: + åe o:@2 å (CC O .group æ diff --git a/phsource/compile_report b/phsource/compile_report index b2a554c5..70b8de18 100644 --- a/phsource/compile_report +++ b/phsource/compile_report @@ -1,50 +1,50 @@ 45 phoneme tables new total - base 97 97 - base2 24 116 - en 53 145 - en_n 30 145 - en_us 37 145 - en_sc 39 147 - en_rp 34 145 - en_wm 30 145 - en_wi 30 145 - af 38 129 - cy 29 123 - de 33 124 - eo 13 109 - jbo 4 110 - fi 40 128 - fr 35 120 - fr_ca 11 120 - hi 50 133 - ta 13 135 - hu 23 113 - nl 28 120 - pl 15 108 - sk 29 126 - cs 6 126 - hr 20 131 - mk 3 132 - sr 14 131 - ru 38 127 - it 17 119 - la 21 115 - es 9 118 - pt 27 132 - pt_pt 20 132 - ro 36 140 - el 8 116 - grc 12 121 - sv 25 119 - no 28 123 - is 32 122 - vi 42 135 - zhy 40 130 - zh 61 144 - sw 14 106 - th 50 140 - id 14 118 + base 99 99 + base2 24 118 + en 53 147 + en_n 30 147 + en_us 37 147 + en_sc 39 149 + en_rp 34 147 + en_wm 30 147 + en_wi 30 147 + af 38 131 + cy 29 125 + de 33 126 + eo 13 111 + jbo 4 112 + fi 40 130 + fr 35 122 + fr_ca 11 122 + hi 50 135 + ta 13 137 + hu 23 115 + nl 28 122 + pl 15 110 + sk 29 128 + cs 6 128 + hr 20 133 + mk 3 134 + sr 14 133 + ru 38 129 + it 17 121 + la 21 117 + es 9 120 + pt 27 134 + pt_pt 20 134 + ro 36 142 + el 8 118 + grc 12 123 + sv 25 121 + no 28 125 + is 32 124 + vi 42 137 + zhy 40 132 + zh 61 146 + sw 14 108 + th 50 142 + id 14 120 Data file Used by b/b [b] base @@ -1144,6 +1144,7 @@ vowel/3_en [3:] en [3:] af [@:] th vowel/@_4 [@] nl + [@] no vowel/8_2 [U] en_us [8] sv vowel/8_3 [eo] zhy @@ -1335,7 +1336,6 @@ vowel/@_hgh [@] en_us [@2] en_us [@5] en_us [@] hr - [@] no vowel/i [i] base2 [i:] en_n [i] en_wm diff --git a/phsource/ph_norwegian b/phsource/ph_norwegian index d12468c3..d4389a3b 100644 --- a/phsource/ph_norwegian +++ b/phsource/ph_norwegian @@ -12,7 +12,7 @@ phoneme @ // close schwa vowel starttype (@) endtype (@) unstressed length 120 - formants vowel/@_hgh + formants vowel/@_4 endphoneme phoneme @2 // open schwa @@ -31,7 +31,7 @@ endphoneme phoneme i: vowel starttype (i) endtype (i) - length 220 + length 230 formants vowel/i after w w/wi2 linkout ; @@ -45,7 +45,7 @@ endphoneme phoneme y: vowel starttype (u) endtype (u) - length 250 + length 260 formants vowel/y_4 endphoneme @@ -57,7 +57,7 @@ endphoneme phoneme Y: vowel starttype (@) endtype (@) - length 250 + length 260 formants vwl_no/y# endphoneme @@ -71,13 +71,13 @@ endphoneme phoneme E: vowel starttype (e) endtype (e) - length 260 + length 270 formants vowel/ee_1 endphoneme phoneme e: vowel starttype (e) endtype (e) - length 240 + length 250 formants vowel/e_2 endphoneme @@ -114,7 +114,7 @@ endphoneme phoneme o: vowel starttype (o) endtype (o) - length 250 + length 270 formants vowel/o_2 endphoneme @@ -126,7 +126,7 @@ endphoneme phoneme u: vowel starttype (u) endtype (u) - length 230 + length 240 formants vowel/u_bck endphoneme @@ -139,7 +139,7 @@ endphoneme phoneme u-: vowel starttype (u) endtype (u) - length 250 + length 260 formants vwl_no/u#2 endphoneme diff --git a/phsource/phonemes b/phsource/phonemes index 94dc2f00..e823f3bb 100644 --- a/phsource/phonemes +++ b/phsource/phonemes @@ -28,7 +28,8 @@ phonemenumber 21 _^_ // Change language phonemenumber 22 _X1 // a language specific action phonemenumber 23 _| // very short pause phonemenumber 24 _:: // long pause -phonemenumber 25 t# // reduced version of [t] +phonemenumber 25 _;_ // clause pause +phonemenumber 26 t# // reduced version of [t] // The base phoneme table contains the utility phonemes, the consonants, // and a schwa. The vowels are defined in the language specific phoneme @@ -71,6 +72,11 @@ phoneme ' // Primary stress endphoneme phoneme '' // Primary stress (priority) + stress + length 5 +endphoneme + +phoneme '! // Primary stress (emphasized) stress length 6 endphoneme @@ -127,6 +133,14 @@ phoneme _:: // Long pause lengthmod 1 endphoneme +phoneme _;_ // clause pause + pause + formants NULL + starttype _ endtype _ + length 150 + lengthmod 1 +endphoneme + phoneme _^_ // Change dictionary (followed by language-code in ascii pause starttype _ endtype _ diff --git a/src/Makefile b/src/Makefile index 5b83fcbd..6eb86530 100644 --- a/src/Makefile +++ b/src/Makefile @@ -3,7 +3,7 @@ INCDIR=/usr/include/espeak LIBDIR=/usr/lib DATADIR=/usr/share/espeak-data -RELEASE = 1.29 +RELEASE = 1.30 BIN_NAME = speak BIN2_NAME = espeak LIB_NAME = libespeak.so @@ -15,20 +15,6 @@ INSTALL = /usr/bin/install LN_SF = /bin/ln -sf MKDIR = mkdir -p -#AUDIO = portaudio -AUDIO = pulseaudio - -ifeq ($(AUDIO),pulseaudio) -WAVE=wave_pulse.cpp -LIB_AUDIO=pulse -USE_AUDIO=USE_PULSEAUDIO -else -#portaudio -WAVE=wave.cpp -LIB_AUDIO=portaudio -USE_AUDIO=USE_PORTAUDIO -endif - speak_SOURCES = speak.cpp compiledict.cpp dictionary.cpp intonation.cpp \ readclause.cpp setlengths.cpp numbers.cpp synth_mbrola.cpp \ synthdata.cpp synthesize.cpp translate.cpp tr_english.cpp \ @@ -38,23 +24,22 @@ libespeak_SOURCES = speak_lib.cpp compiledict.cpp dictionary.cpp intonation.cpp readclause.cpp setlengths.cpp numbers.cpp synth_mbrola.cpp \ synthdata.cpp synthesize.cpp translate.cpp tr_english.cpp \ tr_languages.cpp voices.cpp wavegen.cpp phonemelist.cpp \ - espeak_command.cpp event.cpp fifo.cpp $(WAVE) debug.cpp + espeak_command.cpp event.cpp fifo.cpp wave.cpp debug.cpp SRCS1=$(speak_SOURCES) OBJS1=$(patsubst %.cpp,%.o,$(SRCS1)) -LIBS1=-lstdc++ -l$(LIB_AUDIO) -lpthread +LIBS1=-lstdc++ -lportaudio -lpthread SRCS2=$(libespeak_SOURCES) OBJS2=$(patsubst %.cpp,x_%.o,$(SRCS2)) -LIBS2=-lstdc++ -l$(LIB_AUDIO) -lpthread +LIBS2=-lstdc++ -lportaudio -lpthread SRCS3 = espeak.cpp OBJS3=$(patsubst %.cpp,%.o,$(SRCS3)) LIBS3=-lstdc++ ./libespeak.so -CXXFLAGS=-O2 -D$(USE_AUDIO) -#CXXFLAGS=-D$(USE_AUDIO) -ggdb -DDEBUG_ENABLED +CXXFLAGS=-O2 all: $(BIN_NAME) $(LIB_NAME) $(STATIC_LIB_NAME) $(BIN2_NAME) diff --git a/src/Makefile_pulseaudio b/src/Makefile_pulseaudio new file mode 100644 index 00000000..c8f30398 --- /dev/null +++ b/src/Makefile_pulseaudio @@ -0,0 +1,124 @@ +BINDIR=/usr/bin +INCDIR=/usr/include/espeak +LIBDIR=/usr/lib +DATADIR=/usr/share/espeak-data + +RELEASE = 1.30 +BIN2_NAME = espeak +LIB_NAME = libespeak.so +STATIC_LIB_NAME = libespeak.a +LIB_VERSION = 1 +LIBTAG = $(LIB_VERSION).$(RELEASE) + +INSTALL = /usr/bin/install +LN_SF = /bin/ln -sf +MKDIR = mkdir -p + +#AUDIO = portaudio +AUDIO = pulseaudio + +BIN_NAME = speak + +ifeq ($(AUDIO),pulseaudio) +WAVE=wave_pulse.cpp +LIB_AUDIO=pulse +USE_AUDIO=USE_PULSEAUDIO +# the speak executable is not yet compliant with PulseAudio, +# speak_SOURCES defined for avoiding compilation errors. +speak_SOURCES = speak.cpp compiledict.cpp dictionary.cpp intonation.cpp \ + readclause.cpp setlengths.cpp numbers.cpp synth_mbrola.cpp \ + synthdata.cpp synthesize.cpp translate.cpp tr_english.cpp \ + tr_languages.cpp voices.cpp wavegen.cpp phonemelist.cpp \ + espeak_command.cpp event.cpp fifo.cpp $(WAVE) debug.cpp +else +#portaudio +WAVE=wave.cpp +LIB_AUDIO=portaudio +USE_AUDIO=USE_PORTAUDIO +speak_SOURCES = speak.cpp compiledict.cpp dictionary.cpp intonation.cpp \ + readclause.cpp setlengths.cpp numbers.cpp synth_mbrola.cpp \ + synthdata.cpp synthesize.cpp translate.cpp tr_english.cpp \ + tr_languages.cpp voices.cpp wavegen.cpp phonemelist.cpp + +endif + +speak_SOURCES = speak.cpp compiledict.cpp dictionary.cpp intonation.cpp \ + readclause.cpp setlengths.cpp numbers.cpp synth_mbrola.cpp \ + synthdata.cpp synthesize.cpp translate.cpp tr_english.cpp \ + tr_languages.cpp voices.cpp wavegen.cpp phonemelist.cpp + +libespeak_SOURCES = speak_lib.cpp compiledict.cpp dictionary.cpp intonation.cpp \ + readclause.cpp setlengths.cpp numbers.cpp synth_mbrola.cpp \ + synthdata.cpp synthesize.cpp translate.cpp tr_english.cpp \ + tr_languages.cpp voices.cpp wavegen.cpp phonemelist.cpp \ + espeak_command.cpp event.cpp fifo.cpp $(WAVE) debug.cpp + + +SRCS1=$(speak_SOURCES) +OBJS1=$(patsubst %.cpp,%.o,$(SRCS1)) +LIBS1=-lstdc++ -l$(LIB_AUDIO) -lpthread + +SRCS2=$(libespeak_SOURCES) +OBJS2=$(patsubst %.cpp,x_%.o,$(SRCS2)) +LIBS2=-lstdc++ -l$(LIB_AUDIO) -lpthread + +SRCS3 = espeak.cpp +OBJS3=$(patsubst %.cpp,%.o,$(SRCS3)) +LIBS3=-lstdc++ ./libespeak.so + +#CXXFLAGS=-O2 -D$(USE_AUDIO) +CXXFLAGS=-D$(USE_AUDIO) -ggdb -DDEBUG_ENABLED + + +all: $(BIN_NAME) $(LIB_NAME) $(STATIC_LIB_NAME) $(BIN2_NAME) + mv $(LIB_NAME) $(LIB_NAME).$(LIBTAG) + +.cpp.o: + $(CXX) $(CXXFLAGS) -D PATH_ESPEAK_DATA=\"$(DATADIR)\" -Wall -pedantic -I. -c -fno-exceptions $< + +$(BIN_NAME): $(OBJS1) + $(CXX) -o $@ $(OBJS1) $(LIBS1) + +$(BIN2_NAME): $(OBJS3) $(LIB_NAME) + $(CXX) -o $@ $(OBJS3) $(LIBS3) + + + +x_%.o: %.cpp + $(CXX) $(CXXFLAGS) -Wall -fpic -fvisibility=hidden -pedantic \ + -I. -D LIBRARY -c -fno-exceptions $< -o x_$*.o + +$(LIB_NAME): $(OBJS2) + $(CXX) -shared -Wl,-soname,$(LIB_NAME).$(LIB_VERSION) -o $@ $(OBJS2) $(LIBS2) + +$(STATIC_LIB_NAME): $(OBJS2) + $(AR) cqs $(STATIC_LIB_NAME) $(OBJS2) + +clean: + rm -f *.o *.a *~ + +distclean: clean + rm -f $(BIN_NAME) + rm -f $(BIN2_NAME) + rm -f $(LIB_NAME)* + +install: all + # Create directories + rm -rf $(DESTDIR)$(DATADIR) + $(MKDIR) $(DESTDIR)$(BINDIR) + $(MKDIR) $(DESTDIR)$(LIBDIR) + $(MKDIR) $(DESTDIR)$(INCDIR) + $(MKDIR) $(DESTDIR)$(DATADIR) + # Install espeak executable + $(INSTALL) -m 755 $(BIN2_NAME) $(DESTDIR)$(BINDIR) + # Install shared library + $(INSTALL) -m 755 $(LIB_NAME).$(LIBTAG) $(DESTDIR)$(LIBDIR) + # Install static library + $(INSTALL) -m 755 $(STATIC_LIB_NAME) $(DESTDIR)$(LIBDIR) + $(LN_SF) $(LIB_NAME).$(LIBTAG) $(DESTDIR)$(LIBDIR)/$(LIB_NAME).$(LIB_VERSION) + $(LN_SF) $(LIB_NAME).$(LIB_VERSION) $(DESTDIR)$(LIBDIR)/$(LIB_NAME) + # Install development headers + $(INSTALL) -pm 644 speak_lib.h $(DESTDIR)$(INCDIR) + # Install data files + cp -prf ../espeak-data/* $(DESTDIR)$(DATADIR) + diff --git a/src/dictionary.cpp b/src/dictionary.cpp index b4335658..bb7d95fe 100755 --- a/src/dictionary.cpp +++ b/src/dictionary.cpp @@ -886,7 +886,7 @@ static int GetVowelStress(Translator *tr, unsigned char *phonemes, unsigned char static char stress_phonemes[] = {phonSTRESS_U, phonSTRESS_D, phonSTRESS_2, phonSTRESS_3, - phonSTRESS_P, phonSTRESS_TONIC, phonSTRESS_TONIC}; + phonSTRESS_P, phonSTRESS_P2, phonSTRESS_TONIC}; void ChangeWordStress(Translator *tr, char *word, int new_stress) diff --git a/src/intonation.cpp b/src/intonation.cpp index 4afde5fd..d751af83 100755 --- a/src/intonation.cpp +++ b/src/intonation.cpp @@ -39,6 +39,7 @@ typedef struct { char stress; char env; char flags; //bit 0=pitch rising, bit1=emnphasized + char nextph_type; short pitch1; short pitch2; } SYLLABLE; @@ -901,6 +902,28 @@ void Translator::CalcPitches(int clause_type) SYLLABLE syllable_tab2[N_PHONEME_LIST]; syllable_tab = syllable_tab2; // don't use permanent storage. it's only needed during the call of CalcPitches() + n_st = 0; + n_primary = 0; + for(ix=0; ix<(n_phoneme_list-1); ix++) + { + p = &phoneme_list[ix]; + if(p->synthflags & SFLAG_SYLLABLE) + { + syllable_tab[n_st].flags = 0; + syllable_tab[n_st].env = PITCHfall; + syllable_tab[n_st].nextph_type = phoneme_list[ix+1].type; + syllable_tab[n_st++].stress = p->tone; // stress level + + if(p->tone >= 4) + n_primary++; + } + } + syllable_tab[n_st].stress = 0; // extra 0 entry at the end + + if(n_st == 0) + return; // nothing to do + + if(langopts.tone_language == 1) { @@ -921,26 +944,6 @@ void Translator::CalcPitches(int clause_type) else no_tonic = 0; - n_st = 0; - n_primary = 0; - for(ix=0; ixsynthflags & SFLAG_SYLLABLE) - { - syllable_tab[n_st].flags = 0; - syllable_tab[n_st].env = PITCHfall; - syllable_tab[n_st++].stress = p->tone; // stress level - - if(p->tone >= 4) - n_primary++; - } - } - syllable_tab[n_st].stress = 0; // extra 0 entry at the end - - if(n_st == 0) - return; // nothing to do - st_start = 0; count_primary=0; for(st_ix=0; st_ixstress == 6) { - // reduce the stress of the previous stressed syllable + // reduce the stress of the previous stressed syllable (review only the previous few syllables) for(ix=st_ix-1; ix>=st_start && ix>=(st_ix-3); ix--) { if(syllable_tab[ix].stress == 6) diff --git a/src/phoneme.h b/src/phoneme.h index e8615325..1b938fc9 100755 --- a/src/phoneme.h +++ b/src/phoneme.h @@ -65,7 +65,7 @@ #define phonSTRESS_2 4 #define phonSTRESS_3 5 #define phonSTRESS_P 6 -#define phonSTRESS_TONIC 7 +#define phonSTRESS_P2 7 // priority stress within a word #define phonSTRESS_PREV 8 #define phonPAUSE 9 #define phonPAUSE_SHORT 10 @@ -84,6 +84,7 @@ #define phonPAUSE_VSHORT 23 #define phonPAUSE_LONG 24 #define phonT_REDUCED 25 +#define phonSTRESS_TONIC 26 extern const unsigned char pause_phonemes[8]; // 0, vshort, short, pause, long, glottalstop // place of articulation diff --git a/src/synthdata.cpp b/src/synthdata.cpp index b6e9ada9..06305df6 100755 --- a/src/synthdata.cpp +++ b/src/synthdata.cpp @@ -35,7 +35,7 @@ #include "translate.h" #include "wave.h" -const char *version_string = "1.30.14 15.Jan.08"; +const char *version_string = "1.30.15 17.Jan.08"; const int version_phdata = 0x013010; int option_device_number = -1; diff --git a/src/tr_languages.cpp b/src/tr_languages.cpp index 8d7741ca..f941a63b 100644 --- a/src/tr_languages.cpp +++ b/src/tr_languages.cpp @@ -487,7 +487,7 @@ SetLengthMods(tr,3); // all equal case L('n','o'): // Norwegian { static const unsigned char stress_amps_no[] = {16,16, 20,20, 20,24, 24,22 }; - static const short stress_lengths_no[8] = {160,140, 200,190, 0,0, 220,210}; + static const short stress_lengths_no[8] = {160,140, 200,200, 0,0, 220,210}; tr = new Translator(); SetupTranslator(tr,stress_lengths_no,stress_amps_no); diff --git a/src/translate.cpp b/src/translate.cpp index a78c7faf..bf190db9 100755 --- a/src/translate.cpp +++ b/src/translate.cpp @@ -44,7 +44,7 @@ static char translator2_language[20] = {0}; FILE *f_trans = NULL; // phoneme output text int option_tone1 = 0; int option_tone2 = 0; -int option_tone_flags = 0; // bit 8=emphasize allcaps, bit 9=emphasize penultimate stress +int option_tone_flags = 0x100; // bit 8=emphasize allcaps, bit 9=emphasize penultimate stress int option_phonemes = 0; int option_phoneme_events = 0; int option_quiet = 0; diff --git a/src/wave_pulse.cpp b/src/wave_pulse.cpp index 94652b15..f8cd664d 100755 --- a/src/wave_pulse.cpp +++ b/src/wave_pulse.cpp @@ -50,17 +50,17 @@ enum {ONE_BILLION=1000000000}; #ifdef USE_PULSEAUDIO - static t_wave_callback* my_callback_is_output_enabled=NULL; #define SAMPLE_RATE 22050 -#define FRAMES_PER_BUFFER 512 -#define BUFFER_LENGTH (SAMPLE_RATE*2*sizeof(uint16_t)) -#define THRESHOLD (BUFFER_LENGTH/5) - #define ESPEAK_FORMAT PA_SAMPLE_S16LE #define ESPEAK_CHANNEL 1 +#define MAXLENGTH 132300 +#define TLENGTH 4410 +#define PREBUF 2200 +#define MINREQ 880 +#define FRAGSIZE 0 static pa_context *context = NULL; static pa_stream *stream = NULL; @@ -514,15 +514,11 @@ static int pulse_open() pa_buffer_attr a_attr; - // TBD - a_attr.maxlength=132300; - a_attr.tlength=8820; //88200 - // a_attr.tlength=10000; //88200 - a_attr.prebuf=2200; - a_attr.minreq=880; - a_attr.fragsize=882; - - + a_attr.maxlength = MAXLENGTH; + a_attr.tlength = TLENGTH; + a_attr.prebuf = PREBUF; + a_attr.minreq = MINREQ; + a_attr.fragsize = 0; SHOW_TIME("pa_connect_playback"); if (pa_stream_connect_playback(stream, NULL, &a_attr, (pa_stream_flags_t)(PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_AUTO_TIMING_UPDATE), &volume, NULL) < 0) { @@ -634,21 +630,6 @@ void wave_set_callback_is_output_enabled(t_wave_callback* cb) //> // maxlength=%ld\n",a_attr->maxlength); - SHOW("attr> tlength=%ld\n",a_attr->tlength); - SHOW("attr> prebuf=%ld\n",a_attr->prebuf); - SHOW("attr> minreq=%ld\n",a_attr->minreq); - SHOW("attr> fragsize=%ld\n",a_attr->fragsize); - } -} - void wave_init() { ENTER("wave_init"); @@ -656,15 +637,12 @@ void wave_init() stream = NULL; pulse_open(); - - display_buffer(); - } //> // aTotalFreeMem(%d) >= bytes_to_write(%d)\n", aTotalFreeMem, bytes_to_write); break; } + + // TBD: check if really helpful + if (aTotalFreeMem >= MAXLENGTH*2) + { + aTotalFreeMem = MAXLENGTH*2; + } + SHOW("wave_write > wait: aTotalFreeMem(%d) < bytes_to_write(%d)\n", aTotalFreeMem, bytes_to_write); - // 500: threshold for avoiding to many calls to pulse_write + // 500: threshold for avoiding too many calls to pulse_write if (aTotalFreeMem>500) { pulse_write(aBuffer, aTotalFreeMem); @@ -821,7 +806,7 @@ void *wave_test_get_write_buffer() void wave_init() {} -void* wave_open(char* the_api) {return (void *)1;} +void* wave_open(const char* the_api) {return (void *)1;} size_t wave_write(void* theHandler, char* theMono16BitsWaveBuffer, size_t theSize) {return theSize;} int wave_close(void* theHandler) {return 0;} int wave_is_busy(void* theHandler) {return 0;}