mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-12-01 14:30:37 +00:00
Fix voice attribute suffix ignored in voice name.
lang=cs fix number not spoken after preposition with $alt1 attribute lang=cs Don't allow any thousands separator. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@12 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+1
-1
@@ -1954,7 +1954,7 @@ memset(markers_used,0,sizeof(markers_used));
|
||||
if((f_errors = fopen_log(f_errors,fname,"w")) == NULL)
|
||||
f_errors = stderr;
|
||||
|
||||
sprintf(fname,"%s/%s",path_home,"phondata_manifest");
|
||||
sprintf(fname,"%s/%s",path_home,"phondata-manifest");
|
||||
if((f_phcontents = fopen_log(f_phcontents,fname,"w")) == NULL)
|
||||
f_phcontents = stderr;
|
||||
|
||||
|
||||
+4
-1
@@ -967,7 +967,10 @@ void SpectSeq::MakeWave(int start, int end, PitchEnvelope &pitch)
|
||||
fname_speech = WavFileName();
|
||||
OpenWaveFile2(fname_speech);
|
||||
|
||||
first=1;
|
||||
first = 0;
|
||||
if(start > 0)
|
||||
first=1; // a selection, use fade-in
|
||||
|
||||
sp2 = NULL;
|
||||
for(ix=start; ix<=end; ix++)
|
||||
{
|
||||
|
||||
@@ -479,10 +479,15 @@ Translator *SelectTranslator(const char *name)
|
||||
tr->langopts.spelling_stress = 1;
|
||||
tr->langopts.param[LOPT_COMBINE_WORDS] = 4; // combine some prepositions with the following word
|
||||
|
||||
tr->langopts.numbers = 0x1c0d + 0x84000;
|
||||
// tr->langopts.numbers = 0x1c0d + 0x84000;
|
||||
tr->langopts.numbers = 0x1c01 + 0x84000;
|
||||
tr->langopts.thousands_sep = 0; //no thousands separator
|
||||
tr->langopts.decimal_sep = ',';
|
||||
|
||||
if(name2 == L('c','s'))
|
||||
{
|
||||
tr->langopts.numbers2 = 0x8; // variant numbers before milliards
|
||||
}
|
||||
|
||||
SetLetterVowel(tr,'y');
|
||||
SetLetterVowel(tr,'r');
|
||||
|
||||
+11
-4
@@ -1035,7 +1035,7 @@ int Translator::TranslateWord2(char *word, WORD_TAB *wtab, int pre_pause, int ne
|
||||
int first_phoneme = 1;
|
||||
int source_ix;
|
||||
int len;
|
||||
int limit;
|
||||
int sylimit; // max. number of syllables in a word to be combined with a preceding preposition
|
||||
char *new_language;
|
||||
unsigned char bad_phoneme[4];
|
||||
|
||||
@@ -1112,11 +1112,12 @@ int Translator::TranslateWord2(char *word, WORD_TAB *wtab, int pre_pause, int ne
|
||||
{
|
||||
flags = translator->TranslateWord(word, next_pause, wtab);
|
||||
|
||||
if((flags & FLAG_ALT2_TRANS) && ((limit = langopts.param[LOPT_COMBINE_WORDS]) > 0))
|
||||
if((flags & FLAG_ALT2_TRANS) && ((sylimit = langopts.param[LOPT_COMBINE_WORDS]) > 0))
|
||||
{
|
||||
char *p2;
|
||||
int ok = 1;
|
||||
int flags2;
|
||||
int c_word2;
|
||||
char ph_buf[N_WORD_PHONEMES];
|
||||
|
||||
// LANG=cs,sk
|
||||
@@ -1124,7 +1125,13 @@ int Translator::TranslateWord2(char *word, WORD_TAB *wtab, int pre_pause, int ne
|
||||
p2 = word;
|
||||
while(*p2 != ' ') p2++;
|
||||
|
||||
if(limit & 0x100)
|
||||
utf8_in(&c_word2, p2+1, 0); // first character of the next word;
|
||||
if(!iswalpha(c_word2))
|
||||
{
|
||||
ok =0;
|
||||
}
|
||||
|
||||
if(sylimit & 0x100)
|
||||
{
|
||||
// only if the second word has $alt attribute
|
||||
strcpy(ph_buf,word_phonemes);
|
||||
@@ -1140,7 +1147,7 @@ int Translator::TranslateWord2(char *word, WORD_TAB *wtab, int pre_pause, int ne
|
||||
{
|
||||
*p2 = '-'; // replace next space by hyphen
|
||||
flags = translator->TranslateWord(word, next_pause, wtab); // translate the combined word
|
||||
if(CountSyllables(p) > (limit & 0xf))
|
||||
if(CountSyllables(p) > (sylimit & 0xf))
|
||||
{
|
||||
// revert to separate words
|
||||
*p2 = ' ';
|
||||
|
||||
+10
-1
@@ -1329,6 +1329,7 @@ espeak_ERROR SetVoiceByName(const char *name)
|
||||
espeak_VOICE *v;
|
||||
int variant=0;
|
||||
char *p;
|
||||
char variant_name[20];
|
||||
static char buf[60];
|
||||
|
||||
strncpy0(buf,name,sizeof(buf));
|
||||
@@ -1339,10 +1340,18 @@ espeak_ERROR SetVoiceByName(const char *name)
|
||||
variant = atoi(p+1);
|
||||
}
|
||||
|
||||
// first check for a voice with this filename
|
||||
// first check for a voice with this filename
|
||||
if(LoadVoice(buf,1) != NULL)
|
||||
{
|
||||
voice_selected = first_voice;
|
||||
|
||||
if(variant > 0)
|
||||
{
|
||||
// apply a voice variant
|
||||
sprintf(variant_name,"!variant%d",variant);
|
||||
LoadVoice(variant_name,2);
|
||||
}
|
||||
|
||||
WavegenSetVoice(voice);
|
||||
return(EE_OK);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user