Browse Source

[1.45.45]

Fixed bug where SSML voice change didn't remember an initially specified Klatt variant.

Removed some unused variables and redundant initializations.

Patch to fix a spike from Klatt function setzeroabc()


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@275 d46cf337-b52f-0410-862d-fd96e6ae7743
master
jonsd 13 years ago
parent
commit
d18532991a

+ 2
- 2
dictsource/dict_phonemes View File

@@ -66,7 +66,7 @@ R3 s S t T tS v w
x z Z


Dictionary hu_dict 2011-09-15
Dictionary hu_dict 2011-10-07

a A a: E e: i i: o
o: u u: Y y y: Y:
@@ -102,7 +102,7 @@ p Q r R s s; t T
ts v x z


Dictionary en_dict 2011-09-08
Dictionary en_dict 2011-09-27

0 3 3: @ @- @2 @5 @L
a a# A: A@ aa aI aI@ aU

+ 1
- 0
dictsource/en_list View File

@@ -1669,6 +1669,7 @@ obsolete 0bs@li:t
obstacle 0bst@k@L
ocean oUS@n
oceanic oUSI'anIk
ocelot 0s@l0t
ochre oUk3
o'clock @kl0k
october $2

+ 6
- 6
dictsource/en_rules View File

@@ -33,6 +33,7 @@
.L01 l r
.L02 i y
.L03 a i o u // vowel, not 'e'
.L05 c g k

.L10 grap log met scop // scientific endings

@@ -3544,13 +3545,12 @@
o) mb (e m
_bo) mb (K m
_du) mb m
_) mc m@k
_) mc (_k m@
_) mc (k m@
_) mc (_g m@
_) mc (g m@
_) mc (C m@k
_) mc (_C m@k
_) mc (_L05 m@ // c,g,k
_) mc (L05 m@
_) mc (A mak
_) mc (-A mak
_) mc (_A mak
mn (_ m
&B) me (_ m%I
_) mega mEg@

+ 316
- 1
dictsource/hu_list View File

@@ -1985,6 +1985,321 @@ gyengén $unstressend
jelentőségű $unstressend
elárulta $unstressend
bolygón $unstressend
rázni $unstressend
szóltam $unstressend
fogadni $unstressend
levonni $unstressend
gond $unstressend
jelzéseket $unstressend
modellből $unstressend
kiadás $unstressend
bántani $unstressend
szándéka $unstressend
körét $unstressend
arányát $unstressend
fellépést $unstressend
támogatás $unstressend
felelőséget $unstressend
felelősséget $unstressend
felhasználni $unstressend
fordítsák $unstressend
szolgálják $unstressend
fordítható $unstressend
gazdaságot $unstressend
fizetnek $unstressend
utalványban $unstressend
találmány $unstressend
bevezettek $unstressend
hivatkozva $unstressend
bírálták $unstressend
szabadságát $unstressend
nyújtását $unstressend
támogatást $unstressend
bért $unstressend
juttatást $unstressend
elérhető $unstressend
adatok $unstressend
juttatás $unstressend
fizet $unstressend
számláit $unstressend
szinten $unstressend
rendszerét $unstressend
páron $unstressend
férfin $unstressend
emberen $unstressend
hátránya $unstressend
elvehetik $unstressend
árát $unstressend
önkormányzatoknál $unstressend
adják $unstressend
hírek $unstressend
kilós $unstressend
formájában $unstressend
annál $unstressend
ennél $unstressend
mondod $unstressend
funkciókat $unstressend
nyomom $unstressend
alakulni $unstressend
bajaim $unstressend
oprendszert $unstressend
szántam $unstressend
szántad $unstressend
benned $unstressend
használnom $unstressend
használsz $unstressend
közte $unstressend
tudnak $unstressend
megismerésére $unstressend
hasonlítgatnod $unstressend
értem $unstressend
használható $unstressend
úgytűnt $unstressend
állítható $unstressend
tűnt $unstressend
kedélyeket $unstressend
témára $unstressend
témáról $unstressend
laza $unstressend
mondjuk $unstressend
kijelenteni $unstressend
lehetősége $unstressend
kérnünk $unstressend
témában $unstressend
tűntek $unstressend
lehetnek $unstressend
megközelítésre $unstressend
szükség $unstressend
gondolunk $unstressend
egyszerű $unstressend
fordulatszám $unstressend
kapacitásról $unstressend
fogalmuk $unstressend
döntöttünk $unstressend
stílusú $unstressend
érthető $unstressend
megfogalmazott $unstressend
háttértároló $unstressend
alapú $unstressend
találhatók $unstressend
olvassák $unstressend
halljuk $unstressend
szerkezetűek $unstressend
alkatrész $unstressend
válasz $unstressend
tányér $unstressend
sebessége $unstressend
sebesség $unstressend
értelme $unstressend
eladótól $unstressend
tartalmaznak $unstressend
képesek $unstressend
egyet $unstressend
tárol $unstressend
adatot $unstressend
eltárolni $unstressend
megállapítható $unstressend
gyorsabb $unstressend
élettartama $unstressend
típus $unstressend
változat $unstressend
lassabb $unstressend
tönkre $unstressend
rövidebb $unstressend
cellán $unstressend
gyártók $unstressend
értékek $unstressend
szemléltetve $unstressend
váltakozhat $unstressend
pohár $unstressend
mennyiségét $unstressend
paraméter $unstressend
nézve $unstressend
gondolni $unstressend
elviselni $unstressend
felismerni $unstressend
oldani $unstressend
használhatatlanná $unstressend
harmadik $unstressend
működésről $unstressend
jelentené $unstressend
cella $unstressend
egyenlíteni $unstressend
optimalizálni $unstressend
celláról $unstressend
felvethet $unstressend
bele $unstressend
tárolunk $unstressend
adat $unstressend
soha $unstressend
felügyeli $unstressend
figyel $unstressend
törődnie $unstressend
számon $unstressend
használ $unstressend
kitalálható $unstressend
cellákra $unstressend
teher $unstressend
példát $unstressend
megtelítünk $unstressend
frissülnek $unstressend
találhatóak $unstressend
felületén $unstressend
tehet $unstressend
mondanánk $unstressend
megelőzésére $unstressend
minket $unstressend
érdekében $unstressend
tehetnek $unstressend
érdeme $unstressend
tárolni $unstressend
rendelkezik $unstressend
nevezik $unstressend
méretét $unstressend
életét $unstressend
árulnak $unstressend
emiatt $unstressend
tartalmaznak $unstressend
következik $unstressend
rosszabb $unstressend
hittük $unstressend
kitérünk $unstressend
adatokat $unstressend
helyükön $unstressend
kb $unstressend
blokk $unstressend
korlátozás $unstressend
történik $unstressend
volnánk $unstressend
kezdődik $unstressend
írásra $unstressend
műveleteket $unstressend
területeket $unstressend
takar $unstressend
helyzet $unstressend
szeretnénk $unstressend
lapot $unstressend
fájlunk $unstressend
fájl $unstressend
értelmeznünk $unstressend
gyűjtőneve $unstressend
elvégzik $unstressend
élettartamát $unstressend
igazság $unstressend
generációs $unstressend
típusok $unstressend
sebességét $unstressend
rendszernek $unstressend
tulajoknak $unstressend
programok $unstressend
futtatni $unstressend
eljárni $unstressend
használjuk $unstressend
tennivalónk $unstressend
létezik $unstressend
kérdés $unstressend
blokkok $unstressend
túlléptünk $unstressend
érdekesség $unstressend
léteznek $unstressend
beállítani $unstressend
átpakolni $unstressend
mértékére $unstressend
kezelik $unstressend
visszaállítását $unstressend
esetben $unstressend
valami $unstressend
kéne $unstressend
odafigyelni $unstressend
programba $unstressend
beállítás $unstressend
irányába $unstressend
erőltetik $unstressend
trendi $unstressend
módját $unstressend
nyomtatók $unstressend
monitorok $unstressend
évekből $unstressend
eszközt $unstressend
eszközöket $unstressend
régiek $unstressend
használják $unstressend
számítógépek $unstressend
László $unstressend
éves $unstressend
monitor $unstressend
szemet $unstressend
elavultak $unstressend
kezelni $unstressend
főosztájt $unstressend
selejtezés $unstressend
raktárra $unstressend
használhatatlan $unstressend
épületben $unstressend
konfiguráció $unstressend
modellek $unstressend
laptopok $unstressend
javasolják $unstressend
listán $unstressend
listában $unstressend
éles $unstressend
kompatibilisek $unstressend
szerepelnek $unstressend
95 $unstressend
fogjuk $unstressend
törekednek $unstressend
kapjon $unstressend
eleget $unstressend
kitölthető $unstressend
önöknek $unstressend
önöket $unstressend
fényesek $unstressend
szervezete $unstressend
kapuját $unstressend
manuál $unstressend
regiszter $unstressend
síp $unstressend
intonáció $unstressend
hangszert $unstressend
székházából $unstressend
szándékukat $unstressend
embereket $unstressend
plázát $unstressend
tárjuk $unstressend
társadalmat $unstressend
kérdőívét $unstressend
választani $unstressend
szakítani $unstressend
akad $unstressend
felkeresni $unstressend
oka $unstressend
kitölteni $unstressend
ellenőrzését $unstressend
vásárolt $unstressend
szokásos $unstressend
skálázták $unstressend
vehesse $unstressend
berendezések $unstressend
védelemmel $unstressend
lehetőséget $unstressend
lakók $unstressend
jelszóra $unstressend
lehessen $unstressend
kérdőívet $unstressend
rendszere $unstressend
csökkent $unstressend
csökken $unstressend
ideje $unstressend
megmondja $unstressend
sújtható $unstressend
megbüntetésére $unstressend
alkalmazzák $unstressend
kijelentik $unstressend
kérdésekre $unstressend
vonatkoznak $unstressend
döntenek $unstressend
játszana $unstressend


// word pairs

@@ -2087,7 +2402,7 @@ ny En^
ø $accent
ß _^_DE

//… _p%ontp%ontp%ont // 3 or more dots are changed to elipsis
… _p%ontp%ontp%ont // 3 or more dots are changed to elipsis
. p%ont $max3
_. pont
* tSillAg $max3

+ 7
- 2
dictsource/hu_rules View File

@@ -576,6 +576,8 @@ harmince) gy (edik J:
_í) gy (jár J
száze) gy (es J:
huszone) gy (es J:
_e) gy (é_ J:
_mint-e) gy (é_ J:

.group h
h h
@@ -609,6 +611,7 @@ huszone) gy (es J:
_sz) í (vattákk i
_sz) í (vató i
_v) í (zi i //for example vízipipa, vízimentők beginning words need spokening i, not i: phoneme
_v) í (zió i: //But this word an exception for prewious rule

.group j
j j
@@ -891,8 +894,7 @@ pedagógu) s (sztrájk S
_fúvó) s (zene S
identitá) s (zavar S
fáklyá) s (zen S


_ki) s (zombor S

.group ss
ssz ss2
@@ -1129,6 +1131,7 @@ _farka) ssz (ig Ss
alvá) ssz (eg Ss
lako) ssz (ám Ss
_szencsége) ssz (űz Ss
ki) ssz (ekrény Ss


.group sz
@@ -1559,6 +1562,8 @@ támogato) ts (ág tS:
_á) tsz (orong t|s
_á) tsz (orít t|s
_á) tsz (olgál t|s
felira) ts (áv t|S
pö) tsz (en ts:

.group tt
tt t:

+ 1
- 1
espeak-data/voices/mb/mb-tr2 View File

@@ -2,7 +2,7 @@ name turkish-mbrola-1
language tr 7
gender female

pitch 140 220
pitch 160 230
voicing 170

mbrola tr2 tr1_phtrans

+ 6
- 6
phsource/compile_report View File

@@ -394,7 +394,7 @@ l/l_ [l] base
[l/] fr
l/l_@ [l/3] base
[l/] fr
l/l@ [hÖq] base
l/l@ [h–] base
[l#] base
[l] fr
[l/2] fr
@@ -428,7 +428,7 @@ l/L2_oL [l/2] base
l/L2_uL [l/2] base
l/l_3 [l/] de
l/l_4 [ll] sq
l/la [hÖq] base
l/la [h–] base
[l#] base
[l] fr
[l/2] fr
@@ -436,7 +436,7 @@ l/la [h
[K] tn
l/l_a [l/3] base
[l/] fr
l/le [hÖq] base
l/le [h–] base
[l#] base
[l] fr
[l/2] fr
@@ -448,7 +448,7 @@ l/L_eL_af [&] af
[&:] af
l/l_front [L] sq
l/l_front_ [l/4] sq
l/li [hÖq] base
l/li [h–] base
[l#] base
[l] fr
[l/2] fr
@@ -462,7 +462,7 @@ ll/ll [L] bg
ll/_ll [L] bg
l/l_long [l] base
[l] fr
l/lo [hÖq] base
l/lo [h–] base
[l#] base
[l/2] fr
[K] nso
@@ -472,7 +472,7 @@ l/l_o [l/3] base
l^/l_rfx [l.] base
[l] ru
[l^] ru
l/lu [hÖq] base
l/lu [h–] base
[l#] base
[l] fr
[l/2] fr

+ 0
- 3
src/compiledata.cpp View File

@@ -1264,7 +1264,6 @@ static int NextItem(int type)
unsigned char c2;
int ix;
int sign;
int keyword;
char *p;
keywtab_t *pk;
@@ -1332,8 +1331,6 @@ static int NextItem(int type)
if(!feof(f_in))
unget_char(c);

keyword = -1;

if(type == tSTRING)
{
return(0);

+ 0
- 43
src/compiledict.cpp View File

@@ -31,9 +31,6 @@
#include "synthesize.h"
#include "translate.h"

//#define OPT_FORMAT // format the text and write formatted copy to Log file
//#define OUTPUT_FORMAT

extern void Write4Bytes(FILE *f, int value);
int HashDictionary(const char *string);

@@ -390,13 +387,11 @@ static int compile_line(char *linebuf, char *dict_line, int *hash)
int all_upper_case;
char *mnemptr;
char *comment;
unsigned char flag_codes[100];
char encoded_ph[200];
unsigned char bad_phoneme[4];
static char nullstring[] = {0};

comment = NULL;
text_not_phonemes = 0;
phonetic = word = nullstring;

@@ -497,7 +492,6 @@ step=1; // TEST
if((c == '/') && (p[1] == '/') && (multiple_words==0))
{
c = '\n'; /* "//" treat comment as end of line */
comment = p;
}
switch(step)
@@ -591,12 +585,6 @@ step=1; // TEST
if(word[0] == 0)
{
#ifdef OPT_FORMAT
if(comment != NULL)
fprintf(f_log,"%s",comment);
else
fputc('\n',f_log);
#endif
return(0); /* blank line */
}

@@ -747,35 +735,6 @@ step=1; // TEST
}
dict_line[0] = length;

#ifdef OPT_FORMAT
spaces = 16;
for(ix=0; ix<n_flag_codes; ix++)
{
if(flag_codes[ix] >= 100)
{
fprintf(f_log,"?%d ",flag_codes[ix]-100);
spaces -= 3;
}
}

fprintf(f_log,"%s",word);
spaces -= strlen(word);
DecodePhonemes(encoded_ph,decoded_ph);
while(spaces-- > 0) fputc(' ',f_log);
spaces += (14 - strlen(decoded_ph));
fprintf(f_log," %s",decoded_ph);
while(spaces-- > 0) fputc(' ',f_log);
for(ix=0; ix<n_flag_codes; ix++)
{
if(flag_codes[ix] < 100)
fprintf(f_log," %s",lookup_mnem(mnem_flags,flag_codes[ix]));
}
if(comment != NULL)
fprintf(f_log," %s",comment);
else
fputc('\n',f_log);
#endif

return(length);
} /* end of compile_line */
@@ -1160,7 +1119,6 @@ static char *compile_rule(char *input)
int start;
int state=2;
int finish=0;
int pre_bracket=0;
char buf[80];
char output[150];
unsigned char bad_phoneme[4];
@@ -1183,7 +1141,6 @@ static char *compile_rule(char *input)
case ')': // end of prefix section
*p = 0;
state = 1;
pre_bracket = 1;
copy_rule_string(buf,state);
p = buf;
break;

+ 6
- 16
src/dictionary.cpp View File

@@ -832,7 +832,6 @@ int Unpronouncable(Translator *tr, char *word, int posn)
int vowel_posn=9;
int index;
int count;
int apostrophe=0;

utf8_in(&c,word);
if((tr->letter_bits_offset > 0) && (c < 0x241))
@@ -868,10 +867,7 @@ int Unpronouncable(Translator *tr, char *word, int posn)
break;
}

if(c == '\'')
apostrophe = 1;
else
if(!iswalpha(c))
if((c != '\'') && !iswalpha(c))
return(0);
}

@@ -1123,7 +1119,7 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags,
int final_ph2;
int mnem;
int mnem2;
int post_tonic;
int post_tonic; // currently not used
int opt_length;
int done;
int stressflags;
@@ -1387,7 +1383,7 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags,
{
int wt;
int max_weight = -1;
int prev_stressed;
// int prev_stressed;

// find the heaviest syllable, excluding the final syllable
for(ix = 1; ix < (vowel_count-1); ix++)
@@ -1397,7 +1393,7 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags,
if((wt = syllable_weight[ix]) >= max_weight)
{
max_weight = wt;
prev_stressed = stressed_syllable;
// prev_stressed = stressed_syllable;
stressed_syllable = ix;
}
}
@@ -2166,7 +2162,7 @@ static void MatchRule(Translator *tr, char *word[], char *word_start, int group_
// next 3 bytes are a (non-zero) ending type. 2 bytes of flags + suffix length
end_type = (rule[0] << 16) + ((rule[1] & 0x7f) << 8) + (rule[2] & 0x7f);

if((tr->word_vowel_count == 0) && !(end_type & SUFX_P))
if((tr->word_vowel_count == 0) && !(end_type & SUFX_P) && (tr->langopts.param[LOPT_SUFFIX] & 1))
failed = 1; // don't match a suffix rule if there are no previous syllables (needed for lang=tr).
else
{
@@ -2435,9 +2431,8 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c
Append the result to 'phonemes' and any standard prefix/suffix in 'end_phonemes' */

unsigned char c, c2;
unsigned int c12, c123;
unsigned int c12;
int wc=0;
int wc_prev;
int wc_bytes;
char *p2; /* copy of p for use in double letter chain match */
int found;
@@ -2497,7 +2492,6 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c
while(((c = *p) != ' ') && (c != 0))
{
wc_prev = wc;
wc_bytes = utf8_in(&wc,p);
if(IsAlpha(wc))
any_alpha++;
@@ -2540,7 +2534,6 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c
/* there are some 2 byte chains for this initial letter */
c2 = p[1];
c12 = c + (c2 << 8); /* 2 characters */
c123 = c12 + (p[2] << 16);
g1 = tr->groups2_start[c];
for(g=g1; g < (g1+n); g++)
@@ -3213,13 +3206,10 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor
if(option_phonemes == 2)
{
unsigned int flags1 = 0;
char ph_decoded[N_WORD_PHONEMES];
int textmode;

DecodePhonemes(phonetic,ph_decoded);
if(flags != NULL)
flags1 = flags[0];

if((dictionary_flags & FLAG_TEXTMODE) == 0)
textmode = 0;

+ 0
- 8
src/espeak.cpp View File

@@ -127,7 +127,6 @@ void DisplayVoices(FILE *f_out, char *language)
const char *p;
int len;
int count;
int scores = 0;
const espeak_VOICE *v;
const char *lang_name;
char age_buf[12];
@@ -144,7 +143,6 @@ void DisplayVoices(FILE *f_out, char *language)
voice_select.gender = 0;
voice_select.name = NULL;
voices = espeak_ListVoices(&voice_select);
scores = 1;
}
else
{
@@ -179,8 +177,6 @@ void DisplayVoices(FILE *f_out, char *language)
count++;
p += len+2;
}
// if(scores)
// fprintf(f_out,"%3d ",v->score);
fputc('\n',f_out);
}
} // end of DisplayVoices
@@ -391,14 +387,10 @@ int main (int argc, char **argv)
espeak_VOICE voice_select;
char filename[200];
char voicename[40];
char voice_mbrola[20];
char dictname[40];
#define N_PUNCTLIST 100
wchar_t option_punctlist[N_PUNCTLIST];

voicename[0] = 0;
voice_mbrola[0] = 0;
dictname[0] = 0;
wavefile[0] = 0;
filename[0] = 0;
option_punctlist[0] = 0;

+ 5
- 1
src/event.cpp View File

@@ -386,13 +386,17 @@ static int sleep_until_timeout_or_stop_request(uint32_t time_in_ms)
ENTER("sleep_until_timeout_or_stop_request");

int a_stop_is_required=0;
struct timespec ts, to;
struct timespec ts;
struct timeval tv;
int err=0;

clock_gettime2( &ts);

#ifdef DEBUG_ENABLED
struct timespec to;
to.tv_sec = ts.tv_sec;
to.tv_nsec = ts.tv_nsec;
#endif

add_time_in_ms( &ts, time_in_ms);


+ 8
- 13
src/extras.cpp View File

@@ -325,7 +325,7 @@ void Lexicon_It(int pass)
char buf_out[200];
char buf_error[200];
char last_listx[200];
int test;
static const char *vowels1 = "aeiou";
static const char *vowels2 = "aeou";

@@ -913,7 +913,6 @@ void Lexicon_Bg()
char *pw;
char *pw1;
int cc;
int ix;
int vcount;
int lex_stress;
int input_length;
@@ -929,7 +928,6 @@ void Lexicon_Bg()

FILE *f_in;
FILE *f_out;
FILE *f_log;
char word[80];
char word_in[80];
@@ -967,9 +965,6 @@ void Lexicon_Bg()
return;
}

// sprintf(fname,"%s%c%s",path_dsource,PATHSEP,"bg_log");
// f_log = fopen(fname,"w");

LoadVoice("bg",0);
progress = new wxProgressDialog(_T("Lexicon"),_T(""),input_length);

@@ -1107,7 +1102,6 @@ if(n_stress > 1) n_stress = 1;

fclose(f_in);
fclose(f_out);
// fclose(f_log);

CompileDictionary(path_dsource,"bg",NULL,NULL,0);

@@ -1138,7 +1132,6 @@ void Lexicon_Ru()
FILE *f_in;
FILE *f_out;
FILE *f_log;
FILE *f_roots;
PHONEME_TAB *ph;
int ph_code;
int vcount;
@@ -1151,10 +1144,6 @@ void Lexicon_Ru()
int wlength;
int input_length;

int sfx;
const char *suffix;
int wlen;
int len;
int check_root;

char word[80];
@@ -1173,6 +1162,12 @@ void Lexicon_Ru()
int syllables;
} SUFFIX;

#ifdef deleted
FILE *f_roots;
int sfx;
const char *suffix;
int wlen;
int len;
static SUFFIX suffixes[] = {
{NULL,0},
{"ичу",2},
@@ -1192,7 +1187,7 @@ void Lexicon_Ru()
{"и",1},

{NULL,0}};
#endif

memset(counts,0,sizeof(counts));


+ 42
- 38
src/fifo.cpp View File

@@ -281,48 +281,52 @@ static int sleep_until_start_request_or_inactivity()
// for filtering underflow.
//
int i=0;
while((i<= MAX_INACTIVITY_CHECK) && !a_start_is_required)
{
if (wave_is_busy( NULL) )
while((i<= MAX_INACTIVITY_CHECK) && !a_start_is_required)
{
i = 0;
}
if (wave_is_busy( NULL) )
{
i = 0;
}
else
{
i++;
}
{
i++;
}

int err=0;
struct timespec ts, to;
struct timeval tv;
clock_gettime2( &ts);
to.tv_sec = ts.tv_sec;
to.tv_nsec = ts.tv_nsec;
add_time_in_ms( &ts, INACTIVITY_TIMEOUT);
SHOW("fifo > sleep_until_start_request_or_inactivity > start sem_timedwait (start_is_required) from %d.%09lu to %d.%09lu \n",
to.tv_sec, to.tv_nsec,
ts.tv_sec, ts.tv_nsec);
while ((err = sem_timedwait(&my_sem_start_is_required, &ts)) == -1
&& errno == EINTR)
{
continue;
}
assert (gettimeofday(&tv, NULL) != -1);
SHOW("fifo > sleep_until_start_request_or_inactivity > stop sem_timedwait (start_is_required, err=%d) %d.%09lu \n", err,
tv.tv_sec, tv.tv_usec*1000);
if (err==0)
{
a_start_is_required = 1;
int err=0;
struct timespec ts;
struct timeval tv;

clock_gettime2( &ts);

#ifdef DEBUG_ENABLED
struct timespec to;
to.tv_sec = ts.tv_sec;
to.tv_nsec = ts.tv_nsec;
#endif

add_time_in_ms( &ts, INACTIVITY_TIMEOUT);

SHOW("fifo > sleep_until_start_request_or_inactivity > start sem_timedwait (start_is_required) from %d.%09lu to %d.%09lu \n",
to.tv_sec, to.tv_nsec,
ts.tv_sec, ts.tv_nsec);

while ((err = sem_timedwait(&my_sem_start_is_required, &ts)) == -1
&& errno == EINTR)
{
continue;
}

assert (gettimeofday(&tv, NULL) != -1);
SHOW("fifo > sleep_until_start_request_or_inactivity > stop sem_timedwait (start_is_required, err=%d) %d.%09lu \n", err,
tv.tv_sec, tv.tv_usec*1000);

if (err==0)
{
a_start_is_required = 1;
}
}
}
SHOW_TIME("fifo > sleep_until_start_request_or_inactivity > LEAVE");
return a_start_is_required;
SHOW_TIME("fifo > sleep_until_start_request_or_inactivity > LEAVE");
return a_start_is_required;
}

//>

+ 2
- 8
src/intonation.cpp View File

@@ -787,10 +787,6 @@ static int calc_pitches2(int start, int end, int tune_number)
int ix;
TUNE *tune;
int drop;
int continuing = 0;

if(start > 0)
continuing = 1;

tune = &tunes[tune_number];
ix = start;
@@ -941,7 +937,7 @@ static void CalcPitches_Tone(Translator *tr, int clause_tone)
PHONEME_TAB *tph;
PHONEME_TAB *prev_tph; // forget across word boundary
PHONEME_TAB *prevw_tph; // remember across word boundary
PHONEME_TAB *prev2_tph; // 2 tones previous
// PHONEME_TAB *prev2_tph; // 2 tones previous
PHONEME_LIST *prev_p;

int pitch_adjust = 0; // pitch gradient through the clause - inital value
@@ -949,8 +945,6 @@ static void CalcPitches_Tone(Translator *tr, int clause_tone)
int pitch_low = 0; // until it drops to this
int pitch_high = 0; // then reset to this

p = &phoneme_list[0];

// count number of stressed syllables
p = &phoneme_list[0];
for(ix=0; ix<n_phoneme_list; ix++, p++)
@@ -1066,7 +1060,7 @@ static void CalcPitches_Tone(Translator *tr, int clause_tone)
}

prev_p = p;
prev2_tph = prevw_tph;
// prev2_tph = prevw_tph;
prevw_tph = prev_tph = tph;
pause = 0;
}

+ 15
- 9
src/klatt.cpp View File

@@ -883,12 +883,10 @@ static void setzeroabc(long int f, long int bw, resonator_ptr rp)
double arg;
f = -f;
if(f>=0)
{
f = -1;
}

//NOTE, changes made 30.09.2011 for Reece Dunn <[email protected]>
// fix a sound spike when f=0

/* First compute ordinary resonator coefficients */
/* Let r = exp(-pi bw t) */
arg = kt_globals.minus_pi_t * bw;
@@ -905,9 +903,17 @@ static void setzeroabc(long int f, long int bw, resonator_ptr rp)
rp->a = 1.0 - rp->b - rp->c;
/* Now convert to antiresonator coefficients (a'=1/a, b'=b/a, c'=c/a) */
rp->a = 1.0 / rp->a;
rp->c *= -rp->a;
rp->b *= -rp->a;
/* If f == 0 then rp->a gets set to 0 which makes a'=1/a set a', b' and c' to
* INF, causing an audible sound spike when triggered (e.g. apiration with the
* nasal register set to f=0, bw=0).
*/
if (rp->a != 0)
{
/* Now convert to antiresonator coefficients (a'=1/a, b'=b/a, c'=c/a) */
rp->a = 1.0 / rp->a;
rp->c *= -rp->a;
rp->b *= -rp->a;
}
}



+ 2
- 0
src/mbrowrap.cpp View File

@@ -153,6 +153,7 @@ static int start_mbrola(const char *voice_path)
snprintf(mbr_errorbuf, sizeof(mbr_errorbuf),
"dup2(): %s\n", strerror(errno));
written = write(p_stderr[1], mbr_errorbuf, strlen(mbr_errorbuf));
(void)written; // suppress 'variable not used' warning
_exit(1);
}

@@ -170,6 +171,7 @@ static int start_mbrola(const char *voice_path)
snprintf(mbr_errorbuf, sizeof(mbr_errorbuf),
"mbrola: %s\n", strerror(errno));
written = write(2, mbr_errorbuf, strlen(mbr_errorbuf));
(void)written; // suppress 'variable not used' warning
_exit(1);
}


+ 0
- 5
src/numbers.cpp View File

@@ -506,7 +506,6 @@ void LookupLetter(Translator *tr, unsigned int letter, int next_byte, char *ph_b
static char single_letter[10] = {0,0};
unsigned int dict_flags[2];
char ph_buf3[40];
char *ptr;

ph_buf1[0] = 0;
len = utf8_out(letter,&single_letter[2]);
@@ -552,7 +551,6 @@ void LookupLetter(Translator *tr, unsigned int letter, int next_byte, char *ph_b

// if the $accent flag is set for this letter, use the accents table (below)
dict_flags[1] = 0;
ptr = &single_letter[1];
if(Lookup(tr, &single_letter[1], ph_buf3) == 0)
{
@@ -1586,7 +1584,6 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned
int decimal_count;
int max_decimal_count;
int decimal_mode;
int hyphen;
int suffix_ix;
int skipwords = 0;
char *p;
@@ -1651,12 +1648,10 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned
// NOTE lang=hu, allow both dot and ordinal suffix, eg. "december 21.-én"
// look for an ordinal number suffix after the number
ix++;
hyphen = 0;
p = suffix;
if(wtab[0].flags & FLAG_HYPHEN_AFTER)
{
*p++ = '-';
hyphen = 1;
ix++;
}
while((word[ix] != 0) && (word[ix] != ' ') && (ix < (int)(sizeof(suffix)-1)))

+ 2
- 9
src/phonemelist.cpp View File

@@ -114,7 +114,7 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence)
int insert_ph = 0;
PHONEME_LIST *phlist;
PHONEME_TAB *ph;
PHONEME_TAB *prev, *next, *next2;
PHONEME_TAB *next, *next2;
int unstress_count = 0;
int word_stress = 0;
int switched_language = 0;
@@ -123,7 +123,6 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence)
int regression;
int end_sourceix;
int alternative;
int first_vowel=0; // first vowel in a word
PHONEME_DATA phdata;

int n_ph_list3;
@@ -131,8 +130,7 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence)
PHONEME_LIST *plist3_inserted = NULL;
PHONEME_LIST ph_list3[N_PHONEME_LIST];

static PHONEME_LIST2 ph_list2_null = {0,0,0,0,0,0};
PHONEME_LIST2 *plist2 = &ph_list2_null;
PHONEME_LIST2 *plist2;

plist2 = ph_list2;
phlist = phoneme_list;
@@ -302,8 +300,6 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence)

for(j=0; insert_ph || ((j < n_ph_list3) && (ix < N_PHONEME_LIST-3)); j++)
{
prev = ph;

plist3 = &ph_list3[j];

if(insert_ph != 0)
@@ -448,9 +444,6 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence)
}
}

if(ph->type == phVOWEL)
first_vowel = 0;

if((plist3+1)->synthflags & SFLAG_LENGTHEN)
{
static char types_double[] = {phFRICATIVE,phVFRICATIVE,phNASAL,phLIQUID,0};

+ 3
- 6
src/readclause.cpp View File

@@ -472,10 +472,8 @@ static int GetC(void)
int cbuf[4];
int ix;
int n_bytes;
unsigned char m;
static int ungot2 = 0;
static const unsigned char mask[4] = {0xff,0x1f,0x0f,0x07};
static const unsigned char mask2[4] = {0,0x80,0x20,0x30};

if((c1 = ungot_char) != 0)
{
@@ -516,7 +514,6 @@ static int GetC(void)
if((ix = n_bytes) > 0)
{
c = c1 & mask[ix];
m = mask2[ix];
while(ix > 0)
{
if((c2 = cbuf[ix] = GetC_get()) == 0)
@@ -535,7 +532,6 @@ static int GetC(void)
GetC_unget(c2);
break;
}
m = 0x80;
c = (c << 6) + (c2 & 0x3f);
ix--;
}
@@ -1435,6 +1431,9 @@ void SetVoiceStack(espeak_VOICE *v, const char *variant_name)
sp->voice_variant_number = v->variant;
sp->voice_age = v->age;
sp->voice_gender = v->gender;

if(memcmp(variant_name, "!v/", 3) == 0)
variant_name += 3;// strip variant directory name
strncpy0(base_voice_variant_name, variant_name, sizeof(base_voice_variant_name));
memcpy(&base_voice, &current_voice_selected, sizeof(base_voice));
}
@@ -2094,7 +2093,6 @@ int ReadClause(Translator *tr, FILE *f_in, char *buf, short *charix, int *charix
int punct_data = 0;
int is_end_clause;
int announced_punctuation = 0;
int prev_announced_punctuation;
int stressed_word = 0;
int end_clause_after_tag = 0;
int end_clause_index = 0;
@@ -2502,7 +2500,6 @@ if(option_ssml) parag=1;
linelength = 0;
}

prev_announced_punctuation = announced_punctuation;
announced_punctuation = 0;

if((phoneme_mode==0) && (sayas_mode==0))

+ 0
- 6
src/speak.cpp View File

@@ -159,7 +159,6 @@ void DisplayVoices(FILE *f_out, char *language)
const char *p;
int len;
int count;
int scores = 0;
const espeak_VOICE *v;
const char *lang_name;
char age_buf[12];
@@ -176,7 +175,6 @@ void DisplayVoices(FILE *f_out, char *language)
voice_select.gender = 0;
voice_select.name = NULL;
voices = espeak_ListVoices(&voice_select);
scores = 1;
}
else
{
@@ -211,8 +209,6 @@ void DisplayVoices(FILE *f_out, char *language)
count++;
p += len+2;
}
// if(scores)
// fprintf(f_out,"%3d ",v->score);
fputc('\n',f_out);
}
} // end of DisplayVoices
@@ -511,11 +507,9 @@ int main (int argc, char **argv)
espeak_VOICE voice_select;
char filename[200];
char voicename[40];
char dictname[40];

voicename[0] = 0;
mbrola_name[0] = 0;
dictname[0] = 0;
wavefile[0] = 0;
filename[0] = 0;
option_linelength = 0;

+ 0
- 2
src/speak_lib.cpp View File

@@ -95,11 +95,9 @@ static int dispatch_audio(short* outbuf, int length, espeak_EVENT* event)
case AUDIO_OUTPUT_PLAYBACK:
{
int event_type=0;
int event_data=0;
if(event)
{
event_type = event->type;
event_data = event->id.number;
}

if(event_type == espeakEVENT_SAMPLERATE)

+ 1
- 6
src/spectdisplay.cpp View File

@@ -533,7 +533,6 @@ void SpectDisplay::OnKey(wxKeyEvent& event)
int keyfr;
int control;
int number;
double value;
SpectFrame *sf;
peak_t *pk;
// static short pk_inc1[N_PEAKS] = {2,2,2,5,5,5,5,5,5};
@@ -785,10 +784,6 @@ void SpectDisplay::OnKey(wxKeyEvent& event)
display = 3;
break;

case 0x1052: // CTRL-R
value = sf->GetRms(spectseq->amplitude);
break;

case 0x1053: // CTRL-S
Save(savepath);
break;
@@ -1023,7 +1018,7 @@ void MyFrame::OnNewWindow(wxCommandEvent& event)
else
path_spectload2 = path.GetPath();

// Make another frame, containing a canvas
// Make another frame, containing a canvas
GetClientSize(&width, &height);
MyChild *subframe = new MyChild(myframe, _T("Spectrum"),
wxPoint(10, 0), wxSize(500, height),

+ 2
- 9
src/spectseq.cpp View File

@@ -462,14 +462,13 @@ int SpectSeq::ImportSPC2(wxInputStream & stream)
int n_cycles = 0;
int x;
CYCLE cy;
int pos;
/* count number of cycles */
while(!stream.Eof())
{
pos = stream.TellI();
stream.TellI();
stream.Read(&cy,44);
pos = stream.TellI();
stream.TellI();
if(stream.Eof()) break;
n_cycles++;
@@ -993,7 +992,6 @@ void SpectSeq::MakeWave(int start, int end, PitchEnvelope &pitch)
float sum_length=0;
float prev_length=0;
int first;
int pbase;
char *fname_speech;
SpectFrame *sp1 = NULL;
SpectFrame *sp2;
@@ -1033,7 +1031,6 @@ void SpectSeq::MakeWave(int start, int end, PitchEnvelope &pitch)
}

total_length = int(sum_length);
pbase = voice->pitch_base >> 12;

if((start==end) || (total_length == 0))
{
@@ -1117,8 +1114,6 @@ void SpectFrame::MakeWaveF(int control, PitchEnvelope &pitche, int amplitude, in
int y;
peak_t peaks0[N_PEAKS];
peak_t peaks1[N_PEAKS];
int ipitch;
int pbase;
char *fname_speech;
int synthesizer_type = 0;

@@ -1131,12 +1126,10 @@ void SpectFrame::MakeWaveF(int control, PitchEnvelope &pitche, int amplitude, in
SpeakNextClause(NULL,NULL,2); // stop speaking file

length = duration;
ipitch = int(pitch) << 16;
if(length==0)
length = 200; // default length, mS

len_samples = (length * samplerate) / 1000;
pbase = voice->pitch_base >> 12;
SetPitch(len_samples + 50,pitche.env,9,44);

fname_speech = WavFileName();

+ 0
- 2
src/synth_mbrola.cpp View File

@@ -413,7 +413,6 @@ int MbrolaTranslate(PHONEME_LIST *plist, int n_phonemes, int resume, FILE *f_mbr
PHONEME_TAB *ph_prev;
PHONEME_LIST *p;
PHONEME_LIST *next;
PHONEME_LIST *prev;
PHONEME_DATA phdata;
FMT_PARAMS fmtp;
int pause = 0;
@@ -445,7 +444,6 @@ int MbrolaTranslate(PHONEME_LIST *plist, int n_phonemes, int resume, FILE *f_mbr

p = &plist[phix];
next = &plist[phix+1];
prev = &plist[phix-1];
ph = p->ph;
ph_prev = plist[phix-1].ph;
ph_next = plist[phix+1].ph;

+ 2
- 9
src/synthdata.cpp View File

@@ -35,7 +35,7 @@
#include "translate.h"
#include "wave.h"

const char *version_string = "1.45.43 16.Sep.11";
const char *version_string = "1.45.45 07.Oct.11";
const int version_phdata = 0x014500;

int option_device_number = -1;
@@ -644,13 +644,6 @@ static bool InterpretCondition(Translator *tr, int control, PHONEME_LIST *plist,
if(plist[0].sourceix)
return(false);
}
// if(which==7)
// {
// // nextPh2 not word boundary
// if((plist[1].sourceix) || (plist[2].sourceix))
// return(false);
// }

if(which==6)
{
// nextVowel, not word boundary
@@ -686,7 +679,7 @@ static bool InterpretCondition(Translator *tr, int control, PHONEME_LIST *plist,
}
ph = plist->ph;

if(instn2 < 8)
if(instn2 < 7)
{
// 'data' is a phoneme number
if((phoneme_tab[data]->mnemonic == ph->mnemonic) == true)

+ 0
- 5
src/synthesize.cpp View File

@@ -1319,7 +1319,6 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
unsigned char *pitch_env=NULL;
unsigned char *amp_env;
PHONEME_TAB *ph;
PHONEME_TAB *prev_ph;
static int sourceix=0;

PHONEME_DATA phdata;
@@ -1605,10 +1604,6 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
if(p->ph->phflags & phTRILL)
modulation = 5;

prev_ph = prev->ph;
// if(p->newword)
// prev_ph = phoneme_tab[phonPAUSE]; // pronounce fully at the start of a word

if(!(p->synthflags & SFLAG_SEQCONTINUE))
{
DoAmplitude(p->amp,NULL);

+ 1
- 0
src/tr_languages.cpp View File

@@ -1262,6 +1262,7 @@ SetLengthMods(tr,3); // all equal

tr->langopts.stress_rule = 7; // stress on the last syllable, before any explicitly unstressed syllable
tr->langopts.stress_flags = 0x20; //no automatic secondary stress
tr->langopts.param[LOPT_SUFFIX] = 1;

if(name2 == L('a','z'))
{

+ 0
- 6
src/translate.cpp View File

@@ -798,7 +798,6 @@ int TranslateWord(Translator *tr, char *word_start, int next_pause, WORD_TAB *wt
int prefix_stress;
char *wordx;
char phonemes[N_WORD_PHONEMES];
char *ph_limit;
char prefix_phonemes[N_WORD_PHONEMES];
char unpron_phonemes[N_WORD_PHONEMES];
char end_phonemes[N_WORD_PHONEMES];
@@ -846,7 +845,6 @@ int TranslateWord(Translator *tr, char *word_start, int next_pause, WORD_TAB *wt
unpron_phonemes[0] = 0;
prefix_phonemes[0] = 0;
end_phonemes[0] = 0;
ph_limit = &phonemes[N_WORD_PHONEMES];

if(tr->data_dictlist == NULL)
{
@@ -2366,7 +2364,6 @@ void *TranslateClause(Translator *tr, FILE *f_text, const void *vp_input, int *t
int prev_in;
int prev_out=' ';
int prev_out2;
int prev_in2=0;
int prev_in_save=0;
int next_in;
int next_in_nbytes;
@@ -2390,7 +2387,6 @@ void *TranslateClause(Translator *tr, FILE *f_text, const void *vp_input, int *t
char *p;
int j, k;
int n_digits;
int individual_digits;
int charix_top=0;

short charix[N_TR_SOURCE+4];
@@ -2541,7 +2537,6 @@ p = source;
else
if(source_index > 0)
{
prev_in2 = prev_in;
utf8_in2(&prev_in,&source[source_index-1],1); // prev_in = source[source_index-1];
}

@@ -3137,7 +3132,6 @@ if((c == '/') && (tr->langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(pre
pn = &number_buf[1];
nx = n_digits;
nw = 0;
individual_digits = 0;

if((n_digits > tr->langopts.max_digits) || (word[0] == '0'))
words[ix].flags |= FLAG_INDIVIDUAL_DIGITS;

+ 4
- 1
src/translate.h View File

@@ -256,7 +256,7 @@ extern const int param_defaults[N_SPEECH_PARAM];



#define N_LOPTS 19
#define N_LOPTS 20
#define LOPT_DIERESES 1
// 1=remove [:] from unstressed syllables, 2= remove from unstressed or non-penultimate syllables
// bit 4=0, if stress < 4, bit 4=1, if not the highest stress in the word
@@ -323,6 +323,9 @@ extern const int param_defaults[N_SPEECH_PARAM];
// recognize long vowels (0 = don't recognize)
#define LOPT_LONG_VOWEL_THRESHOLD 18

// bit 0: Don't allow suffices if there is no previous syllable
#define LOPT_SUFFIX 19


// stress_rule
#define STRESSPOSN_1L 0 // 1st syllable

+ 1
- 2
src/voices.cpp View File

@@ -532,7 +532,6 @@ voice_t *LoadVoice(const char *vname, int control)
int n;
int value;
int value2;
int error = 0;
int langix = 0;
int tone_only = control & 2;
int language_set = 0;
@@ -986,7 +985,7 @@ voice_t *LoadVoice(const char *vname, int control)
}
voice->phoneme_tab_ix = ix;
new_translator->phoneme_tab_ix = ix;
error = LoadDictionary(new_translator, new_dictionary, control & 4);
LoadDictionary(new_translator, new_dictionary, control & 4);
if(dictionary_name[0]==0)
return(NULL); // no dictionary loaded


+ 0
- 4
src/vowelchart.cpp View File

@@ -391,7 +391,6 @@ void FindPhonemesUsed(void)
int hash;
char *p;
unsigned int *pw;
char *start;
char *next;
unsigned char c;
int count = 0;
@@ -449,7 +448,6 @@ void FindPhonemesUsed(void)
if(c == RULE_PHONEMES)
{
ignore = 0;
start = p;
p++;
while((c = *p) != 0)
{
@@ -592,7 +590,6 @@ void MakeVowelLists(void)
int colour;
int voice_found;
PHONEME_PROG_LOG *prog_log_table;
PHONEME_PROG_LOG *prog_log_end;
PHONEME_PROG_LOG *found_prog;
PHONEME_PROG_LOG this_prog;
char dirname[sizeof(path_source)+20];
@@ -613,7 +610,6 @@ void MakeVowelLists(void)
return;
ix = fread(prog_log_table, 1, ix, f_prog_log);
fclose(f_prog_log);
prog_log_end = prog_log_table + ix;
n_prog_log = ix / sizeof(PHONEME_PROG_LOG);

progress = new wxProgressDialog(_T("Vowel charts"),_T(""),n_phoneme_tables);

+ 1
- 1
src/wave.cpp View File

@@ -606,7 +606,7 @@ static void update_output_parameters(int selectedDevice, const PaDeviceInfo *dev
if (deviceInfo)
{
double aLatency = deviceInfo->defaultLowOutputLatency;
double aCoeff = round(0.100 / aLatency);
// double aCoeff = round(0.100 / aLatency);
// myOutputParameters.suggestedLatency = aCoeff * aLatency; // to avoid glitches ?
myOutputParameters.suggestedLatency = aLatency; // for faster response ?
SHOW("Device=%d, myOutputParameters.suggestedLatency=%f, aCoeff=%f\n",

Loading…
Cancel
Save