mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-13 17:23:44 +00:00
Merge branch 'development'
Conflicts: src/Makefile.espeakedit src/speech.h
This commit is contained in:
+2
-1
@@ -586,6 +586,7 @@ int TranslateLetter(Translator *tr, char *word, char *phonemes, int control)
|
||||
// return number of bytes used by the letter
|
||||
// control bit 0: a non-initial letter in a word
|
||||
// bit 1: say 'capital'
|
||||
// bit 2: say character code for unknown letters
|
||||
|
||||
int n_bytes;
|
||||
int letter;
|
||||
@@ -743,7 +744,7 @@ int TranslateLetter(Translator *tr, char *word, char *phonemes, int control)
|
||||
}
|
||||
}
|
||||
|
||||
if(!(control & 2) && (al_flags & AL_NOT_CODE))
|
||||
if(!(control & 4) && (al_flags & AL_NOT_CODE))
|
||||
{
|
||||
// don't speak the character code number, unless we want full details of this character
|
||||
speak_letter_number = 0;
|
||||
|
||||
+1
-1
@@ -339,7 +339,7 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence)
|
||||
ph = phoneme_tab[plist3->phcode];
|
||||
plist3[0].ph = ph;
|
||||
|
||||
if(plist3->phcode == phonSWITCH)
|
||||
if((plist3->phcode == phonSWITCH) && !(plist3->synthflags & SFLAG_EMBEDDED)) // ?? phonSWITCH can't have SFLAG_EMBEDDED ??
|
||||
{
|
||||
if((plist3[1].phcode == phonSWITCH) || ((plist3[1].type == phPAUSE) && (plist3[2].phcode == phonSWITCH)))
|
||||
continue; // next phoneme is also a phonSWITCH, so ignore
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef _ESPEAKEDIT
|
||||
// USE_PORTAUDIO or USE_PULSEAUDIO are now defined in the makefile
|
||||
#define USE_PORTAUDIO
|
||||
#define USE_ASYNC
|
||||
#define LOG_FRAMES // write keyframe info to log-espeakedit
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
#include "translate.h"
|
||||
#include "wave.h"
|
||||
|
||||
const char *version_string = "1.46.46 11.Mar.13";
|
||||
const char *version_string = "1.46.47 12.Mar.13";
|
||||
const int version_phdata = 0x014640;
|
||||
|
||||
int option_device_number = -1;
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
#define OFFSET_ETHIOPIC 0x1200
|
||||
|
||||
|
||||
// character ranges must be listed in ascending order
|
||||
ALPHABET alphabets [] = {
|
||||
{"_el", OFFSET_GREEK, 0x380, 0x3ff, L('e','l'), AL_DONT_NAME | AL_NOT_LETTERS},
|
||||
{"_cyr", OFFSET_CYRILLIC, 0x400, 0x52f, 0, 0},
|
||||
@@ -97,6 +98,7 @@ ALPHABET alphabets [] = {
|
||||
{"_braille", 0x2800, 0x2800,0x28ff, 0, AL_NO_SYMBOL},
|
||||
{"_ja", 0x3040, 0x3040,0x30ff, 0, AL_NOT_CODE},
|
||||
{"_zh", 0x3100, 0x3100,0x9fff, 0, AL_NOT_CODE},
|
||||
{"_ko", 0xa700, 0xa700,0xd7ff, 0, AL_NOT_CODE},
|
||||
{NULL, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
@@ -108,9 +110,12 @@ ALPHABET *AlphabetFromChar(int c)
|
||||
|
||||
while(alphabet->name != NULL)
|
||||
{
|
||||
if((c >= alphabet->range_min) && (c <= alphabet->range_max))
|
||||
if(c <= alphabet->range_max)
|
||||
{
|
||||
return(alphabet);
|
||||
if(c >= alphabet->range_min)
|
||||
return(alphabet);
|
||||
else
|
||||
break;
|
||||
}
|
||||
alphabet++;
|
||||
}
|
||||
@@ -827,6 +832,7 @@ Translator *SelectTranslator(const char *name)
|
||||
case L('h','i'): // Hindi
|
||||
case L('n','e'): // Nepali
|
||||
case L('p','a'): // Punjabi
|
||||
case L('g','u'): // Gujarati
|
||||
{
|
||||
static const short stress_lengths_hi[8] = {190, 190, 210, 210, 0, 0, 230, 250};
|
||||
static const unsigned char stress_amps_hi[8] = {17,14, 20,19, 20,22, 22,21 };
|
||||
@@ -1543,7 +1549,7 @@ SetLengthMods(tr,3); // all equal
|
||||
0x1a1, 0x1edd, 0x1edb, 0x1edf, 0x1ee1, 0x1ee3, // ơ
|
||||
0x75, 0xf9, 0xfa, 0x1ee7, 0x169, 0x1ee5, // u
|
||||
0x1b0, 0x1eeb, 0x1ee9, 0x1eed, 0x1eef, 0x1ef1, // ư
|
||||
0x79, 0x1ef3, 0xfd, 0x1ef7, 0x1ef9, 0x1e, 0 }; // y
|
||||
0x79, 0x1ef3, 0xfd, 0x1ef7, 0x1ef9, 0x1ef5, 0 }; // y
|
||||
|
||||
SetupTranslator(tr,stress_lengths_vi,stress_amps_vi);
|
||||
tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable
|
||||
|
||||
+7
-4
@@ -633,8 +633,10 @@ static char *SpeakIndividualLetters(Translator *tr, char *word, char *phonemes,
|
||||
int capitals = 0;
|
||||
int non_initial = 0;
|
||||
|
||||
if (spell_word > 2)
|
||||
capitals = 2;
|
||||
if(spell_word > 2)
|
||||
capitals = 2; // speak 'capital'
|
||||
if(spell_word > 1)
|
||||
capitals |= 4; // speak charater code for unknown letters
|
||||
|
||||
while((*word != ' ') && (*word != 0))
|
||||
{
|
||||
@@ -1109,7 +1111,7 @@ int TranslateWord(Translator *tr, char *word_start, int next_pause, WORD_TAB *wt
|
||||
// change to another language in order to translate this word
|
||||
strcpy(word_phonemes,unpron_phonemes);
|
||||
if(strcmp(&unpron_phonemes[1],"en")==0)
|
||||
return(FLAG_SPELLWORD); // _^_en must have been set in TranslateLetter(), not *_rules
|
||||
return(FLAG_SPELLWORD); // _^_en must have been set in TranslateLetter(), not *_rules which uses only _^_
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -1774,6 +1776,7 @@ static int TranslateWord2(Translator *tr, char *word, WORD_TAB *wtab, int pre_pa
|
||||
word_flags = wtab[0].flags;
|
||||
if(word_flags & FLAG_EMBEDDED)
|
||||
{
|
||||
wtab[0].flags &= ~FLAG_EMBEDDED; // clear it in case we call TranslateWord2() again for the same word
|
||||
embedded_flag = SFLAG_EMBEDDED;
|
||||
|
||||
Word_EmbeddedCmd();
|
||||
@@ -2121,7 +2124,7 @@ static int TranslateWord2(Translator *tr, char *word, WORD_TAB *wtab, int pre_pa
|
||||
{
|
||||
ph_list2[n_ph_list2].phcode = ph_code;
|
||||
ph_list2[n_ph_list2].sourceix = 0;
|
||||
ph_list2[n_ph_list2].synthflags = embedded_flag;
|
||||
ph_list2[n_ph_list2].synthflags = 0;
|
||||
ph_list2[n_ph_list2++].tone_ph = *p;
|
||||
SelectPhonemeTable(*p);
|
||||
p++;
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
#define CTRL_EMBEDDED 0x01 // control character at the start of an embedded command
|
||||
#define REPLACED_E 'E' // 'e' replaced by silent e
|
||||
|
||||
#define N_WORD_PHONEMES 160 // max phonemes in a word
|
||||
#define N_WORD_PHONEMES 200 // max phonemes in a word
|
||||
#define N_WORD_BYTES 160 // max bytes for the UTF8 characters in a word
|
||||
#define N_CLAUSE_WORDS 300 // max words in a clause
|
||||
#define N_RULE_GROUP2 120 // max num of two-letter rule chains
|
||||
|
||||
Reference in New Issue
Block a user