git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@127 d46cf337-b52f-0410-862d-fd96e6ae7743master
| i i. i[ iou o o- ou u | i i. i[ iou o o- ou u | ||||
| uai y | 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; | S; t th ts ts. ts. tS; tS; | ||||
| tsh v w x z z. | tsh v w x z z. | ||||
| & @ @2 a A a: aI aU | & @ @2 a A a: aI aU | ||||
| E e e: i I i: l- O | E e e: i I i: l- O | ||||
| o o: oU r* r- u U u: | o o: oU r* r- u U u: | ||||
| y | |||||
| * b d dZ dZ; f g h | * b d dZ dZ; f g h | ||||
| j k l L l^ m n N | j k l L l^ m n N |
| // pronunciation exceptions | // pronunciation exceptions | ||||
| linux $1 | |||||
| méxico mExiko | méxico mExiko | ||||
| mexicano mExikano | mexicano mExikano | ||||
| .group i | .group i | ||||
| _) i (_ i | _) i (_ i | ||||
| i i | i i | ||||
| i (A j | |||||
| i (A J^ | |||||
| l) i (A %i | l) i (A %i | ||||
| r) i (A %i | r) i (A %i | ||||
| .group o | .group o | ||||
| _) o (_ o | _) o (_ o | ||||
| o o | o o | ||||
| oy oI | |||||
| oy (K oI | |||||
| oy (_ 'oI | oy (_ 'oI | ||||
| .group x | .group x | ||||
| _) x (_ Ekis | _) x (_ Ekis | ||||
| x ks | x ks | ||||
| A) x (A ks | |||||
| x (_ =ks | |||||
| A) x (A Qs | |||||
| x (_ =Qs | |||||
| .group y | .group y | ||||
| _m) y J | _m) y J | ||||
| _n) y J | _n) y J | ||||
| _l) y J | _l) y J | ||||
| y (A j | |||||
| y (A J^ | |||||
| .group z | .group z |
| ñ Entilde | ñ Entilde | ||||
| ô o:aksA~siRkO~flEks | ô o:aksA~siRkO~flEks | ||||
| ö o:tRema | ö o:tRema | ||||
| ù u:aksA~gRav | |||||
| û u:aksA~siRkO~flEks | |||||
| ü u:tRema | |||||
| ù y:aksA~gRav | |||||
| û y:aksA~siRkO~flEks | |||||
| ü y:tRema | |||||
| _y i:gR'Ek | _y i:gR'Ek | ||||
| ne $u $verbf | ne $u $verbf | ||||
| // questions | // questions | ||||
| où $pause | |||||
| où $brk | |||||
| // auxillary verbs (be, have, can, etc) | // auxillary verbs (be, have, can, etc) | ||||
| suis $u+ $verb | suis $u+ $verb | ||||
| (nord est) nOREst | (nord est) nOREst | ||||
| écho Eko | écho Eko | ||||
| cci $abbrev | cci $abbrev | ||||
| espeak ispik | |||||
| nvda $abbrev | nvda $abbrev | ||||
| open Op'En | open Op'En | ||||
| outlook autluk | outlook autluk | ||||
| gadget gadZEt | gadget gadZEt | ||||
| hamlet amlEt | hamlet amlEt | ||||
| internet E~tERnEt | internet E~tERnEt | ||||
| (internet explorer) E~tErn'Et||EksplOr'Wr | |||||
| jacket ZakEt | jacket ZakEt | ||||
| knesset knEsEt | knesset knEsEt | ||||
| lazaret lazaREt | lazaret lazaREt | ||||
| windows windoz | windows windoz | ||||
| word wORd | word wORd | ||||
| wright _^_EN | 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 | yacht jot | ||||
| aoû u // août | aoû u // août | ||||
| au (l_ O // Paul | au (l_ O // Paul | ||||
| au o // autruche | au o // autruche | ||||
| aud (_ o // chaud | |||||
| au o // autruche | |||||
| p) ay (s Ei // pays paysage | p) ay (s Ei // pays paysage | ||||
| ay (C E // aymé | ay (C E // aymé | ||||
| ay Ej // paye | ay Ej // paye | ||||
| lum) en (t_ A~ | lum) en (t_ A~ | ||||
| rum) en (t_ A~ // prudemment | rum) en (t_ A~ // prudemment | ||||
| _cli) en (t_ A~ // client | |||||
| _cli) en (t A~ // client | |||||
| _laur) en (t_ A~ | _laur) en (t_ A~ | ||||
| _mécont) en (t_ A~ | _mécont) en (t_ A~ | ||||
| _cont) en (t_ A~ | _cont) en (t_ A~ | ||||
| w) er (s_ WR | w) er (s_ WR | ||||
| er (_ e // parler léger | er (_ e // parler léger | ||||
| er (_A eR // parler léger | |||||
| er (s_ e | er (s_ e | ||||
| i) ert (_t2 e // requiert | i) ert (_t2 e // requiert | ||||
| _) ok (_ oke // OK | _) ok (_ oke // OK | ||||
| o (mm O // comme | o (mm O // comme | ||||
| dr) o (me_ o // vélodrome | dr) o (me_ o // vélodrome | ||||
| ph) o (ne_ O // téléphone | |||||
| om (b O~ // bombe | om (b O~ // bombe | ||||
| om (p O~ // pompe | om (p O~ // pompe | ||||
| n) om (_ O~ // nom | n) om (_ O~ // nom | ||||
| onsh (A O~z // bonshommes | onsh (A O~z // bonshommes | ||||
| onh (A On // bonhomme | 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 | z) o (ne_ o // amazone | ||||
| c) o (ne_ o | c) o (ne_ o | ||||
| _) q (_ ky | _) q (_ ky | ||||
| q k // coq | q k // coq | ||||
| qu k // quatre | qu k // quatre | ||||
| que (_ k@ // puisque | |||||
| _) que (_ k@ // que | |||||
| que (_ k@- // puisque banque... | |||||
| _) qu' (P3 k // qu'il | _) qu' (P3 k // qu'il | ||||
| n) q (_ k // cinq cent | n) q (_ k // cinq cent | ||||
| right _^_EN // copyright | right _^_EN // copyright | ||||
| _su) rr RR // surréaliste | _su) rr RR // surréaliste | ||||
| ou) rr RR // courrai | ou) rr RR // courrai | ||||
| rre (_ R // barre | |||||
| rre (_ R@- // barre | |||||
| rr R // erreur | rr R // erreur | ||||
| r r // rien | r r // rien | ||||
| .group t | .group t | ||||
| _) t (_ te | _) t (_ te | ||||
| t t // bataille | 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 | ts (_S1 z2 // silent at end of word unless next word starts with a vowel | ||||
| C) t (_ t // compost watt soft script malttact abrupt | 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 | r) t (_ t2 // fort | ||||
| aul) t (_ // Renault | aul) t (_ // Renault | ||||
| © _^_EN | © _^_EN | ||||
| ® R@ZistR'@d_m'aRk | ® R@ZistR'@d_m'aRk | ||||
| // unstressed words. Note single-syllable cmavo are all unstressed in jbo_rules | |||||
| e'o $u+ // request | 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 | i $u+ $pause | ||||
| boi bOI_: | boi bOI_: | ||||
| vau vaU_: | vau vaU_: | ||||
| kei keI_: | kei keI_: | ||||
| // pronouns | |||||
| mi $u+ | |||||
| do $u+ | |||||
| ti $u+ | |||||
| ta $u+ | |||||
| tu $u+ | |||||
| zo'e $u+ | |||||
| toi tOI_: |
| a a | a a | ||||
| ai aI | ai aI | ||||
| au aU | au aU | ||||
| X) a (_ %a // single-syllable cmavo are unstressed | |||||
| X) ai (_ %aI | |||||
| X) au (_ %aU | |||||
| .group b | .group b | ||||
| b b | b b | ||||
| .group e | .group e | ||||
| e e | e e | ||||
| ei eI | ei eI | ||||
| X) e (_ %e | |||||
| X) ei (_ %eI | |||||
| .group f | .group f | ||||
| f f | f f | ||||
| .group i | .group i | ||||
| i i | i i | ||||
| i (A j | i (A j | ||||
| X) i (_ %i | |||||
| X) i (A_ %j | |||||
| .group j | .group j | ||||
| j Z | j Z | ||||
| .group o | .group o | ||||
| o o | o o | ||||
| oi OI | oi OI | ||||
| X) o (_ %o | |||||
| X) oi (_ %OI | |||||
| .group p | .group p | ||||
| p p | p p | ||||
| .group u | .group u | ||||
| u u | u u | ||||
| u (A w | u (A w | ||||
| X) u (_ %u | |||||
| X) u (A_ %w | |||||
| .group v | .group v | ||||
| v v | v v |
| der dE:r | der dE:r | ||||
| her hE:r | her hE:r | ||||
| kom kOm | kom kOm | ||||
| noe nu:@2 // ?? | |||||
| loe lu: $capital | |||||
| system syst'e:m | system syst'e:m |
| o (CC O | o (CC O | ||||
| oi OI | oi OI | ||||
| oe Y: // ø | |||||
| oe (CC W | |||||
| oey Yy | |||||
| oe O@2 | |||||
| @b) oe (_ u: | |||||
| o (nd U | o (nd U | ||||
| o (rt U | o (rt U | ||||
| o (rd u: // ?? or just for "bord" ? | |||||
| b) o (rd u: | |||||
| o (st U | o (st U | ||||
| .group p | .group p | ||||
| .group å | .group å | ||||
| å o: | å o: | ||||
| åe o:@2 | |||||
| å (CC O | å (CC O | ||||
| .group æ | .group æ |
| 45 phoneme tables | 45 phoneme tables | ||||
| new total | 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 | Data file Used by | ||||
| b/b [b] base | b/b [b] base | ||||
| [3:] af | [3:] af | ||||
| [@:] th | [@:] th | ||||
| vowel/@_4 [@] nl | vowel/@_4 [@] nl | ||||
| [@] no | |||||
| vowel/8_2 [U] en_us | vowel/8_2 [U] en_us | ||||
| [8] sv | [8] sv | ||||
| vowel/8_3 [eo] zhy | vowel/8_3 [eo] zhy | ||||
| [@2] en_us | [@2] en_us | ||||
| [@5] en_us | [@5] en_us | ||||
| [@] hr | [@] hr | ||||
| [@] no | |||||
| vowel/i [i] base2 | vowel/i [i] base2 | ||||
| [i:] en_n | [i:] en_n | ||||
| [i] en_wm | [i] en_wm |
| vowel starttype (@) endtype (@) | vowel starttype (@) endtype (@) | ||||
| unstressed | unstressed | ||||
| length 120 | length 120 | ||||
| formants vowel/@_hgh | |||||
| formants vowel/@_4 | |||||
| endphoneme | endphoneme | ||||
| phoneme @2 // open schwa | phoneme @2 // open schwa | ||||
| phoneme i: | phoneme i: | ||||
| vowel starttype (i) endtype (i) | vowel starttype (i) endtype (i) | ||||
| length 220 | |||||
| length 230 | |||||
| formants vowel/i | formants vowel/i | ||||
| after w w/wi2 | after w w/wi2 | ||||
| linkout ; | linkout ; | ||||
| phoneme y: | phoneme y: | ||||
| vowel starttype (u) endtype (u) | vowel starttype (u) endtype (u) | ||||
| length 250 | |||||
| length 260 | |||||
| formants vowel/y_4 | formants vowel/y_4 | ||||
| endphoneme | endphoneme | ||||
| phoneme Y: | phoneme Y: | ||||
| vowel starttype (@) endtype (@) | vowel starttype (@) endtype (@) | ||||
| length 250 | |||||
| length 260 | |||||
| formants vwl_no/y# | formants vwl_no/y# | ||||
| endphoneme | endphoneme | ||||
| phoneme E: | phoneme E: | ||||
| vowel starttype (e) endtype (e) | vowel starttype (e) endtype (e) | ||||
| length 260 | |||||
| length 270 | |||||
| formants vowel/ee_1 | formants vowel/ee_1 | ||||
| endphoneme | endphoneme | ||||
| phoneme e: | phoneme e: | ||||
| vowel starttype (e) endtype (e) | vowel starttype (e) endtype (e) | ||||
| length 240 | |||||
| length 250 | |||||
| formants vowel/e_2 | formants vowel/e_2 | ||||
| endphoneme | endphoneme | ||||
| phoneme o: | phoneme o: | ||||
| vowel starttype (o) endtype (o) | vowel starttype (o) endtype (o) | ||||
| length 250 | |||||
| length 270 | |||||
| formants vowel/o_2 | formants vowel/o_2 | ||||
| endphoneme | endphoneme | ||||
| phoneme u: | phoneme u: | ||||
| vowel starttype (u) endtype (u) | vowel starttype (u) endtype (u) | ||||
| length 230 | |||||
| length 240 | |||||
| formants vowel/u_bck | formants vowel/u_bck | ||||
| endphoneme | endphoneme | ||||
| phoneme u-: | phoneme u-: | ||||
| vowel starttype (u) endtype (u) | vowel starttype (u) endtype (u) | ||||
| length 250 | |||||
| length 260 | |||||
| formants vwl_no/u#2 | formants vwl_no/u#2 | ||||
| endphoneme | endphoneme | ||||
| phonemenumber 22 _X1 // a language specific action | phonemenumber 22 _X1 // a language specific action | ||||
| phonemenumber 23 _| // very short pause | phonemenumber 23 _| // very short pause | ||||
| phonemenumber 24 _:: // long 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, | // The base phoneme table contains the utility phonemes, the consonants, | ||||
| // and a schwa. The vowels are defined in the language specific phoneme | // and a schwa. The vowels are defined in the language specific phoneme | ||||
| endphoneme | endphoneme | ||||
| phoneme '' // Primary stress (priority) | phoneme '' // Primary stress (priority) | ||||
| stress | |||||
| length 5 | |||||
| endphoneme | |||||
| phoneme '! // Primary stress (emphasized) | |||||
| stress | stress | ||||
| length 6 | length 6 | ||||
| endphoneme | endphoneme | ||||
| lengthmod 1 | lengthmod 1 | ||||
| endphoneme | endphoneme | ||||
| phoneme _;_ // clause pause | |||||
| pause | |||||
| formants NULL | |||||
| starttype _ endtype _ | |||||
| length 150 | |||||
| lengthmod 1 | |||||
| endphoneme | |||||
| phoneme _^_ // Change dictionary (followed by language-code in ascii | phoneme _^_ // Change dictionary (followed by language-code in ascii | ||||
| pause | pause | ||||
| starttype _ endtype _ | starttype _ endtype _ |
| LIBDIR=/usr/lib | LIBDIR=/usr/lib | ||||
| DATADIR=/usr/share/espeak-data | DATADIR=/usr/share/espeak-data | ||||
| RELEASE = 1.29 | |||||
| RELEASE = 1.30 | |||||
| BIN_NAME = speak | BIN_NAME = speak | ||||
| BIN2_NAME = espeak | BIN2_NAME = espeak | ||||
| LIB_NAME = libespeak.so | LIB_NAME = libespeak.so | ||||
| LN_SF = /bin/ln -sf | LN_SF = /bin/ln -sf | ||||
| MKDIR = mkdir -p | 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 \ | speak_SOURCES = speak.cpp compiledict.cpp dictionary.cpp intonation.cpp \ | ||||
| readclause.cpp setlengths.cpp numbers.cpp synth_mbrola.cpp \ | readclause.cpp setlengths.cpp numbers.cpp synth_mbrola.cpp \ | ||||
| synthdata.cpp synthesize.cpp translate.cpp tr_english.cpp \ | synthdata.cpp synthesize.cpp translate.cpp tr_english.cpp \ | ||||
| readclause.cpp setlengths.cpp numbers.cpp synth_mbrola.cpp \ | readclause.cpp setlengths.cpp numbers.cpp synth_mbrola.cpp \ | ||||
| synthdata.cpp synthesize.cpp translate.cpp tr_english.cpp \ | synthdata.cpp synthesize.cpp translate.cpp tr_english.cpp \ | ||||
| tr_languages.cpp voices.cpp wavegen.cpp phonemelist.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) | SRCS1=$(speak_SOURCES) | ||||
| OBJS1=$(patsubst %.cpp,%.o,$(SRCS1)) | OBJS1=$(patsubst %.cpp,%.o,$(SRCS1)) | ||||
| LIBS1=-lstdc++ -l$(LIB_AUDIO) -lpthread | |||||
| LIBS1=-lstdc++ -lportaudio -lpthread | |||||
| SRCS2=$(libespeak_SOURCES) | SRCS2=$(libespeak_SOURCES) | ||||
| OBJS2=$(patsubst %.cpp,x_%.o,$(SRCS2)) | OBJS2=$(patsubst %.cpp,x_%.o,$(SRCS2)) | ||||
| LIBS2=-lstdc++ -l$(LIB_AUDIO) -lpthread | |||||
| LIBS2=-lstdc++ -lportaudio -lpthread | |||||
| SRCS3 = espeak.cpp | SRCS3 = espeak.cpp | ||||
| OBJS3=$(patsubst %.cpp,%.o,$(SRCS3)) | OBJS3=$(patsubst %.cpp,%.o,$(SRCS3)) | ||||
| LIBS3=-lstdc++ ./libespeak.so | 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) | all: $(BIN_NAME) $(LIB_NAME) $(STATIC_LIB_NAME) $(BIN2_NAME) |
| 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) | |||||
| static char stress_phonemes[] = {phonSTRESS_U, phonSTRESS_D, phonSTRESS_2, phonSTRESS_3, | 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) | void ChangeWordStress(Translator *tr, char *word, int new_stress) |
| char stress; | char stress; | ||||
| char env; | char env; | ||||
| char flags; //bit 0=pitch rising, bit1=emnphasized | char flags; //bit 0=pitch rising, bit1=emnphasized | ||||
| char nextph_type; | |||||
| short pitch1; | short pitch1; | ||||
| short pitch2; | short pitch2; | ||||
| } SYLLABLE; | } SYLLABLE; | ||||
| SYLLABLE syllable_tab2[N_PHONEME_LIST]; | SYLLABLE syllable_tab2[N_PHONEME_LIST]; | ||||
| syllable_tab = syllable_tab2; // don't use permanent storage. it's only needed during the call of CalcPitches() | 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) | if(langopts.tone_language == 1) | ||||
| { | { | ||||
| else | else | ||||
| no_tonic = 0; | no_tonic = 0; | ||||
| n_st = 0; | |||||
| n_primary = 0; | |||||
| for(ix=0; ix<n_phoneme_list; 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++].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; | st_start = 0; | ||||
| count_primary=0; | count_primary=0; | ||||
| for(st_ix=0; st_ix<n_st; st_ix++) | for(st_ix=0; st_ix<n_st; st_ix++) | ||||
| if(syl->stress == 6) | if(syl->stress == 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--) | for(ix=st_ix-1; ix>=st_start && ix>=(st_ix-3); ix--) | ||||
| { | { | ||||
| if(syllable_tab[ix].stress == 6) | if(syllable_tab[ix].stress == 6) |
| #define phonSTRESS_2 4 | #define phonSTRESS_2 4 | ||||
| #define phonSTRESS_3 5 | #define phonSTRESS_3 5 | ||||
| #define phonSTRESS_P 6 | #define phonSTRESS_P 6 | ||||
| #define phonSTRESS_TONIC 7 | |||||
| #define phonSTRESS_P2 7 // priority stress within a word | |||||
| #define phonSTRESS_PREV 8 | #define phonSTRESS_PREV 8 | ||||
| #define phonPAUSE 9 | #define phonPAUSE 9 | ||||
| #define phonPAUSE_SHORT 10 | #define phonPAUSE_SHORT 10 | ||||
| #define phonPAUSE_VSHORT 23 | #define phonPAUSE_VSHORT 23 | ||||
| #define phonPAUSE_LONG 24 | #define phonPAUSE_LONG 24 | ||||
| #define phonT_REDUCED 25 | #define phonT_REDUCED 25 | ||||
| #define phonSTRESS_TONIC 26 | |||||
| extern const unsigned char pause_phonemes[8]; // 0, vshort, short, pause, long, glottalstop | extern const unsigned char pause_phonemes[8]; // 0, vshort, short, pause, long, glottalstop | ||||
| // place of articulation | // place of articulation |
| #include "translate.h" | #include "translate.h" | ||||
| #include "wave.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; | const int version_phdata = 0x013010; | ||||
| int option_device_number = -1; | int option_device_number = -1; |
| case L('n','o'): // Norwegian | case L('n','o'): // Norwegian | ||||
| { | { | ||||
| static const unsigned char stress_amps_no[] = {16,16, 20,20, 20,24, 24,22 }; | 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(); | tr = new Translator(); | ||||
| SetupTranslator(tr,stress_lengths_no,stress_amps_no); | SetupTranslator(tr,stress_lengths_no,stress_amps_no); | ||||
| FILE *f_trans = NULL; // phoneme output text | FILE *f_trans = NULL; // phoneme output text | ||||
| int option_tone1 = 0; | int option_tone1 = 0; | ||||
| int option_tone2 = 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_phonemes = 0; | ||||
| int option_phoneme_events = 0; | int option_phoneme_events = 0; | ||||
| int option_quiet = 0; | int option_quiet = 0; |
| #ifdef USE_PULSEAUDIO | #ifdef USE_PULSEAUDIO | ||||
| static t_wave_callback* my_callback_is_output_enabled=NULL; | static t_wave_callback* my_callback_is_output_enabled=NULL; | ||||
| #define SAMPLE_RATE 22050 | #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_FORMAT PA_SAMPLE_S16LE | ||||
| #define ESPEAK_CHANNEL 1 | #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_context *context = NULL; | ||||
| static pa_stream *stream = NULL; | static pa_stream *stream = NULL; | ||||
| pa_buffer_attr a_attr; | 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"); | 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) { | 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) { | ||||
| //> | //> | ||||
| //<wave_init | //<wave_init | ||||
| void display_buffer() | |||||
| { | |||||
| const pa_buffer_attr *a_attr = pa_stream_get_buffer_attr (stream); | |||||
| if (a_attr) | |||||
| { | |||||
| SHOW("attr> 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() | void wave_init() | ||||
| { | { | ||||
| ENTER("wave_init"); | ENTER("wave_init"); | ||||
| stream = NULL; | stream = NULL; | ||||
| pulse_open(); | pulse_open(); | ||||
| display_buffer(); | |||||
| } | } | ||||
| //> | //> | ||||
| //<wave_open | //<wave_open | ||||
| void* wave_open(char* the_api) | |||||
| void* wave_open(const char* the_api) | |||||
| { | { | ||||
| ENTER("wave_open"); | ENTER("wave_open"); | ||||
| return((void*)1); | return((void*)1); | ||||
| SHOW("wave_write > aTotalFreeMem(%d) >= bytes_to_write(%d)\n", aTotalFreeMem, bytes_to_write); | SHOW("wave_write > aTotalFreeMem(%d) >= bytes_to_write(%d)\n", aTotalFreeMem, bytes_to_write); | ||||
| break; | 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); | 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) | if (aTotalFreeMem>500) | ||||
| { | { | ||||
| pulse_write(aBuffer, aTotalFreeMem); | pulse_write(aBuffer, aTotalFreeMem); | ||||
| void wave_init() {} | 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;} | size_t wave_write(void* theHandler, char* theMono16BitsWaveBuffer, size_t theSize) {return theSize;} | ||||
| int wave_close(void* theHandler) {return 0;} | int wave_close(void* theHandler) {return 0;} | ||||
| int wave_is_busy(void* theHandler) {return 0;} | int wave_is_busy(void* theHandler) {return 0;} |