mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-07 23:31:26 +00:00
Merge pull request #870
This commit is contained in:
@@ -201,7 +201,7 @@ ESPEAK_API int espeak_Initialize(espeak_AUDIO_OUTPUT output, int buflength, cons
|
||||
|
||||
buflength: The length in mS of sound buffers passed to the SynthCallback function.
|
||||
Value=0 gives a default of 60mS.
|
||||
This paramater is only used for AUDIO_OUTPUT_RETRIEVAL and AUDIO_OUTPUT_SYNCHRONOUS modes.
|
||||
This parameter is only used for AUDIO_OUTPUT_RETRIEVAL and AUDIO_OUTPUT_SYNCHRONOUS modes.
|
||||
|
||||
path: The directory which contains the espeak-ng-data directory, or NULL for the default location.
|
||||
|
||||
@@ -235,7 +235,7 @@ int SynthCallback(short *wav, int numsamples, espeak_EVENT *events);
|
||||
sometimes be zero (which does NOT indicate end of synthesis).
|
||||
|
||||
events: an array of espeak_EVENT items which indicate word and sentence events, and
|
||||
also the occurance if <mark> and <audio> elements within the text. The list of
|
||||
also the occurrence if <mark> and <audio> elements within the text. The list of
|
||||
events is terminated by an event of type = 0.
|
||||
|
||||
|
||||
|
||||
@@ -857,7 +857,7 @@ static int NextItemMax(int max)
|
||||
|
||||
static int NextItemBrackets(int type, int control)
|
||||
{
|
||||
// Expect a parameter inside parantheses
|
||||
// Expect a parameter inside parentheses
|
||||
// control: bit 0 0= need (
|
||||
// bit 1 1= allow comma
|
||||
|
||||
|
||||
@@ -613,7 +613,7 @@ const char *GetTranslatedPhonemeString(int phoneme_mode)
|
||||
for (p = phon_buf2; *p != 0;) {
|
||||
p += utf8_in(&c, p);
|
||||
if (use_tie != 0) {
|
||||
// look for non-inital alphabetic character, but not diacritic, superscript etc.
|
||||
// look for non-initial alphabetic character, but not diacritic, superscript etc.
|
||||
if ((count > 0) && !(flags & (1 << (count-1))) && ((c < 0x2b0) || (c > 0x36f)) && iswalpha(c))
|
||||
buf += utf8_out(use_tie, buf);
|
||||
}
|
||||
@@ -663,7 +663,7 @@ static int LetterGroupNo(char *rule)
|
||||
* Returns number of letter group
|
||||
*/
|
||||
int groupNo = *rule;
|
||||
groupNo = groupNo - 'A'; // substracting 'A' makes letter_group equal to number in .Lxx definition
|
||||
groupNo = groupNo - 'A'; // subtracting 'A' makes letter_group equal to number in .Lxx definition
|
||||
if (groupNo < 0) // fix sign if necessary
|
||||
groupNo += 256;
|
||||
return groupNo;
|
||||
@@ -2310,7 +2310,7 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c
|
||||
// is it a bracket ?
|
||||
if (letter == 0xe000+'(') {
|
||||
if (pre_pause < tr->langopts.param2[LOPT_BRACKET_PAUSE])
|
||||
pre_pause = tr->langopts.param2[LOPT_BRACKET_PAUSE]; // a bracket, aleady spoken by AnnouncePunctuation()
|
||||
pre_pause = tr->langopts.param2[LOPT_BRACKET_PAUSE]; // a bracket, already spoken by AnnouncePunctuation()
|
||||
}
|
||||
if (IsBracket(letter)) {
|
||||
if (pre_pause < tr->langopts.param[LOPT_BRACKET_PAUSE])
|
||||
@@ -3018,7 +3018,7 @@ int RemoveEnding(Translator *tr, char *word, int end_type, char *word_copy)
|
||||
int len;
|
||||
char ending[50] = {0};
|
||||
|
||||
// these lists are language specific, but are only relevent if the 'e' suffix flag is used
|
||||
// these lists are language specific, but are only relevant if the 'e' suffix flag is used
|
||||
static const char *add_e_exceptions[] = {
|
||||
"ion", NULL
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program; if not, see: <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// This source file is only used for asynchronious modes
|
||||
// This source file is only used for asynchronous modes
|
||||
|
||||
#include "config.h"
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ extern "C"
|
||||
// Initialize the event component.
|
||||
// First function to be called.
|
||||
// the callback will be called when the event actually occurs.
|
||||
// The callback is detailled in speak_lib.h .
|
||||
// The callback is detailed in speak_lib.h .
|
||||
void event_init(void);
|
||||
void event_set_callback(t_espeak_callback *cb);
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program; if not, see: <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// This source file is only used for asynchronious modes
|
||||
// This source file is only used for asynchronous modes
|
||||
|
||||
#include "config.h"
|
||||
|
||||
|
||||
@@ -431,7 +431,7 @@ static int SetHeadIntonation(SYLLABLE *syllable_tab, TUNE *tune, int syl_ix, int
|
||||
|
||||
pitch_range = (tune->head_end - tune->head_start) << 8;
|
||||
pitch_range_abs = abs(pitch_range);
|
||||
drops = drops_0; // this should be controled by tune->head_drops
|
||||
drops = drops_0; // this should be controlled by tune->head_drops
|
||||
initial = true;
|
||||
|
||||
stage = 0;
|
||||
@@ -784,7 +784,7 @@ static void CalcPitches_Tone(Translator *tr)
|
||||
PHONEME_TAB *prevw_tph; // remember across word boundary
|
||||
PHONEME_LIST *prev_p;
|
||||
|
||||
int pitch_adjust = 0; // pitch gradient through the clause - inital value
|
||||
int pitch_adjust = 0; // pitch gradient through the clause - initial value
|
||||
int pitch_decrement = 0; // decrease by this for each stressed syllable
|
||||
int pitch_low = 0; // until it drops to this
|
||||
int pitch_high = 0; // then reset to this
|
||||
|
||||
@@ -721,7 +721,7 @@ static void pitch_synch_par_reset(klatt_frame_ptr frame)
|
||||
/*
|
||||
function SETABC
|
||||
|
||||
Convert formant freqencies and bandwidth into resonator difference
|
||||
Convert formant frequencies and bandwidth into resonator difference
|
||||
equation constants.
|
||||
*/
|
||||
|
||||
@@ -748,7 +748,7 @@ static void setabc(long int f, long int bw, resonator_ptr rp)
|
||||
/*
|
||||
function SETZEROABC
|
||||
|
||||
Convert formant freqencies and bandwidth into anti-resonator difference
|
||||
Convert formant frequencies and bandwidth into anti-resonator difference
|
||||
equation constants.
|
||||
*/
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ typedef struct {
|
||||
long T0; /* Fundamental period in output samples times 4 */
|
||||
long nopen; /* Number of samples in open phase of period */
|
||||
long nmod; /* Position in period to begin noise amp. modul */
|
||||
long nrand; /* Varible used by random number generator */
|
||||
long nrand; /* Variable used by random number generator */
|
||||
double pulse_shape_a; /* Makes waveshape of glottal pulse when open */
|
||||
double pulse_shape_b; /* Makes waveshape of glottal pulse when open */
|
||||
double minus_pi_t;
|
||||
|
||||
@@ -1704,7 +1704,7 @@ static int LookupNum3(Translator *tr, int value, char *ph_out, bool suppress_nul
|
||||
if (ph_ordinal2[0] != 0) {
|
||||
ix = strlen(buf1);
|
||||
if ((ix > 0) && (buf1[ix-1] == phonPAUSE_SHORT))
|
||||
buf1[ix-1] = 0; // remove pause before addding ordinal suffix
|
||||
buf1[ix-1] = 0; // remove pause before adding ordinal suffix
|
||||
strcpy(buf2, ph_ordinal2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -394,7 +394,7 @@ static espeak_ng_STATUS LoadSoundFile(const char *fname, int index, espeak_ng_ER
|
||||
|
||||
static int LookupSoundicon(int c)
|
||||
{
|
||||
// Find the sound icon number for a punctuation chatacter
|
||||
// Find the sound icon number for a punctuation character
|
||||
int ix;
|
||||
|
||||
for (ix = N_SOUNDICON_SLOTS; ix < n_soundicon_tab; ix++) {
|
||||
|
||||
@@ -104,7 +104,7 @@ static void EndAmplitude(void)
|
||||
|
||||
static void EndPitch(int voice_break)
|
||||
{
|
||||
// posssible end of pitch envelope, fill in the length
|
||||
// possible end of pitch envelope, fill in the length
|
||||
if ((pitch_length > 0) && (last_pitch_cmd >= 0)) {
|
||||
if (wcmdq[last_pitch_cmd][1] == 0)
|
||||
wcmdq[last_pitch_cmd][1] = pitch_length;
|
||||
|
||||
@@ -266,7 +266,7 @@ typedef struct {
|
||||
#define INSTN_RETURN 0x0001
|
||||
#define INSTN_CONTINUE 0x0002
|
||||
|
||||
// Group 0 instrcutions with 8 bit operand. These values go into bits 8-15 of the instruction
|
||||
// Group 0 instructions with 8 bit operand. These values go into bits 8-15 of the instruction
|
||||
#define i_CHANGE_PHONEME 0x01
|
||||
#define i_REPLACE_NEXT_PHONEME 0x02
|
||||
#define i_INSERT_PHONEME 0x03
|
||||
|
||||
@@ -391,7 +391,7 @@ static void SetArabicLetters(Translator *tr)
|
||||
|
||||
static void SetCyrillicLetters(Translator *tr)
|
||||
{
|
||||
// Set letter types for Cyrillic script languages: bg (Bulgarian), ru (Russian), tt (Tatar), uk (Ukranian).
|
||||
// Set letter types for Cyrillic script languages: bg (Bulgarian), ru (Russian), tt (Tatar), uk (Ukrainian).
|
||||
|
||||
// character codes offset by 0x420
|
||||
static const char cyrl_soft[] = { 0x2c, 0x19, 0x27, 0x29, 0 }; // letter group B [k ts; s;] -- ь й ч щ
|
||||
@@ -1461,7 +1461,7 @@ Translator *SelectTranslator(const char *name)
|
||||
tr->letter_bits_offset = OFFSET_TAMIL;
|
||||
tr->langopts.numbers = NUM_OMIT_1_THOUSAND;
|
||||
tr->langopts.numbers2 = NUM2_ORDINAL_AND_THOUSANDS;
|
||||
tr->langopts.param[LOPT_WORD_MERGE] = 1; // don't break vowels betwen words
|
||||
tr->langopts.param[LOPT_WORD_MERGE] = 1; // don't break vowels between words
|
||||
} else if (name2 == L('m', 'l')) {
|
||||
static const short stress_lengths_ml[8] = { 180, 160, 240, 240, 0, 0, 260, 260 };
|
||||
SetupTranslator(tr, stress_lengths_ml, stress_amps_equal);
|
||||
|
||||
@@ -474,7 +474,7 @@ static char *SpeakIndividualLetters(Translator *tr, char *word, char *phonemes,
|
||||
if (spell_word > 2)
|
||||
capitals = 2; // speak 'capital'
|
||||
if (spell_word > 1)
|
||||
capitals |= 4; // speak charater code for unknown letters
|
||||
capitals |= 4; // speak character code for unknown letters
|
||||
|
||||
while ((*word != ' ') && (*word != 0)) {
|
||||
word += TranslateLetter(tr, word, phonemes, capitals | non_initial, current_alphabet);
|
||||
@@ -1923,7 +1923,7 @@ static int TranslateChar(Translator *tr, char *ptr, int prev_in, unsigned int c,
|
||||
if (final > 0)
|
||||
*insert = final + 0x11a7;
|
||||
} else {
|
||||
// extact the initial and insert the remainder with a null initial
|
||||
// extract the initial and insert the remainder with a null initial
|
||||
c = initial + 0x1100;
|
||||
*insert = (11*28*21) + (medial*28) + final + 0xac00;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ extern "C"
|
||||
#define FLAG_LAST_WORD 0x10 // last word in clause
|
||||
#define FLAG_EMBEDDED 0x40 // word is preceded by embedded commands
|
||||
#define FLAG_HYPHEN 0x80
|
||||
#define FLAG_NOSPACE 0x100 // word is not seperated from previous word by a space
|
||||
#define FLAG_NOSPACE 0x100 // word is not separated from previous word by a space
|
||||
#define FLAG_FIRST_WORD 0x200 // first word in clause
|
||||
#define FLAG_FOCUS 0x400 // the focus word of a clause
|
||||
#define FLAG_EMPHASIZED 0x800
|
||||
@@ -299,7 +299,7 @@ typedef struct {
|
||||
// bit 1=LANG=cz,bg don't propagate over [v]
|
||||
// bit 2=don't propagate acress word boundaries
|
||||
// bit 3=LANG=pl, propagate over liquids and nasals
|
||||
// bit 4=LANG=cz,sk don't progagate to [v]
|
||||
// bit 4=LANG=cz,sk don't propagate to [v]
|
||||
// bit 8=devoice word-final consonants
|
||||
#define LOPT_REGRESSIVE_VOICING 4
|
||||
|
||||
@@ -342,7 +342,7 @@ typedef struct {
|
||||
// bit 1: stressed syllable: $alt change [e],[o] to [E],[O], $alt2 change [E],[O] to [e],[o]
|
||||
#define LOPT_ALT 15
|
||||
|
||||
// pause for bracket (default=4), pause when annoucing bracket names (default=2)
|
||||
// pause for bracket (default=4), pause when announcing bracket names (default=2)
|
||||
#define LOPT_BRACKET_PAUSE 16
|
||||
|
||||
// bit 1, don't break clause before annoucning . ? !
|
||||
@@ -443,7 +443,7 @@ typedef struct {
|
||||
#define NUM_HUNDRED_AND 0x00000040 // add "and" after hundred or thousand
|
||||
#define NUM_SINGLE_AND 0x00000080 // don't have "and" both after hundreds and also between tens and units
|
||||
#define NUM_SINGLE_STRESS 0x00000100 // only one primary stress in tens+units
|
||||
#define NUM_SINGLE_VOWEL 0x00000200 // only one vowel betwen tens and units
|
||||
#define NUM_SINGLE_VOWEL 0x00000200 // only one vowel between tens and units
|
||||
#define NUM_OMIT_1_HUNDRED 0x00000400 // omit "one" before "hundred"
|
||||
#define NUM_1900 0x00000800 // say 19** as nineteen hundred
|
||||
#define NUM_ALLOW_SPACE 0x00001000 // allow space as thousands separator (in addition to langopts.thousands_sep)
|
||||
|
||||
Reference in New Issue
Block a user