mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-12 08:50:01 +00:00
Merge branch 'development'
This commit is contained in:
+2
-2
@@ -1,5 +1,5 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 to 2014 by Jonathan Duddington *
|
||||
* Copyright (C) 2005 to 2015 by Jonathan Duddington *
|
||||
* email: jonsd@users.sourceforge.net *
|
||||
* Copyright (C) 2013 by Reece H. Dunn *
|
||||
* *
|
||||
@@ -652,7 +652,7 @@ void OnOptions2(int event_id)
|
||||
break;
|
||||
|
||||
case MENU_PATH_DATA:
|
||||
string = wxDirSelector(_T("espeak_data directory"), wxEmptyString);
|
||||
string = wxDirSelector(_T("espeak_data directory"), path_espeakdata);
|
||||
if(!string.IsEmpty())
|
||||
{
|
||||
if(!wxDirExists(string+_T("/voices")))
|
||||
|
||||
+17
-5
@@ -1,5 +1,5 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 to 2014 by Jonathan Duddington *
|
||||
* Copyright (C) 2005 to 2015 by Jonathan Duddington *
|
||||
* email: jonsd@users.sourceforge.net *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "translate.h"
|
||||
|
||||
|
||||
|
||||
#define M_LIGATURE 0x8000
|
||||
#define M_NAME 0
|
||||
#define M_SMALLCAP 1
|
||||
#define M_TURNED 2
|
||||
@@ -107,7 +107,7 @@ static ACCENTS accents_tab[] = {
|
||||
|
||||
#define CAPITAL 0
|
||||
#define LETTER(ch,mod1,mod2) (ch-59)+(mod1 << 6)+(mod2 << 11)
|
||||
#define LIGATURE(ch1,ch2,mod1) (ch1-59)+((ch2-59) << 6)+(mod1 << 12)+0x8000
|
||||
#define LIGATURE(ch1,ch2,mod1) (ch1-59)+((ch2-59) << 6)+(mod1 << 12)+M_LIGATURE
|
||||
|
||||
|
||||
#define L_ALPHA 60 // U+3B1
|
||||
@@ -447,7 +447,7 @@ void LookupAccentedLetter(Translator *tr, unsigned int letter, char *ph_buf)
|
||||
if(basic_letter < 'a')
|
||||
basic_letter = non_ascii_tab[basic_letter-59];
|
||||
|
||||
if(accent_data & 0x8000)
|
||||
if(accent_data & M_LIGATURE)
|
||||
{
|
||||
letter2 = (accent_data >> 6) & 0x3f;
|
||||
letter2 += 59;
|
||||
@@ -460,6 +460,12 @@ void LookupAccentedLetter(Translator *tr, unsigned int letter, char *ph_buf)
|
||||
}
|
||||
|
||||
|
||||
if((accent1==0) && !(accent_data & M_LIGATURE))
|
||||
{
|
||||
// just a letter name, not an accented character or ligature
|
||||
return;
|
||||
}
|
||||
|
||||
if((flags1 = Lookup(tr, accents_tab[accent1].name, ph_accent1)) != 0)
|
||||
{
|
||||
|
||||
@@ -1551,7 +1557,7 @@ static int LookupNum2(Translator *tr, int value, int thousandplex, const int con
|
||||
|
||||
// no, speak as tens+units
|
||||
|
||||
if((control & 0x10) && (value < 10))
|
||||
if((value < 10) && (control & 0x10))
|
||||
{
|
||||
// speak leading zero
|
||||
Lookup(tr, "_0", ph_tens);
|
||||
@@ -1966,6 +1972,12 @@ static int LookupNum3(Translator *tr, int value, char *ph_out, int suppress_null
|
||||
x |= 0x208; // use #f form for both tens and units
|
||||
}
|
||||
|
||||
if(tr->langopts.numbers2 & NUM2_ZERO_TENS)
|
||||
{
|
||||
// LANG=zh
|
||||
x |= 0x10;
|
||||
}
|
||||
|
||||
if(LookupNum2(tr, tensunits, thousandplex, x | (control & 0x100), buf2) != 0)
|
||||
{
|
||||
if(tr->langopts.numbers & NUM_SINGLE_AND)
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 to 2014 by Jonathan Duddington *
|
||||
* Copyright (C) 2005 to 2015 by Jonathan Duddington *
|
||||
* email: jonsd@users.sourceforge.net *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -39,7 +39,7 @@
|
||||
#endif
|
||||
|
||||
#include <locale.h>
|
||||
#define N_XML_BUF 256
|
||||
#define N_XML_BUF 500
|
||||
|
||||
|
||||
static const char *xmlbase = ""; // base URL from <speak>
|
||||
@@ -2402,9 +2402,9 @@ f_input = f_in; // for GetC etc
|
||||
else
|
||||
if((c1 == '<') && (ssml_ignore_l_angle != '<'))
|
||||
{
|
||||
if(c2 == '!')
|
||||
if((c2 == '!') || (c2 == '?'))
|
||||
{
|
||||
// a comment, ignore until closing '<'
|
||||
// a comment, ignore until closing '<' (or <?xml tag )
|
||||
while(!Eof() && (c1 != '>'))
|
||||
{
|
||||
c1 = GetC();
|
||||
|
||||
+2
-2
@@ -168,7 +168,7 @@ void SetSpeed(int control)
|
||||
{
|
||||
DoSonicSpeed(1 * 1024);
|
||||
}
|
||||
if((wpm_value > 450) || ((wpm_value > speed.fast_settings[0]) && (wpm > 350)))
|
||||
if((wpm_value >= 450) || ((wpm_value > speed.fast_settings[0]) && (wpm > 350)))
|
||||
{
|
||||
wpm2 = wpm;
|
||||
wpm = 175;
|
||||
@@ -313,7 +313,7 @@ speed.min_sample_len = (speed.min_sample_len * samplerate_native) / 22050;
|
||||
|
||||
#ifdef TEST_SPEED
|
||||
//if(control==3)
|
||||
printf("%3d: speedf %d %d %d pause=%d %d wav=%d lenmod=%d %d\n",wpm,speed1,speed2,speed3, speed.pause_factor,speed.clause_pause_factor, speed.wav_factor,speed.lenmod_factor,speed.lenmod2_factor);
|
||||
printf("%3d: speedf %d %d %d x=%d pause=%d %d wav=%d lenmod=%d %d\n",wpm,speed1,speed2,speed3, speed_lookup[wpm2-80], speed.pause_factor,speed.clause_pause_factor, speed.wav_factor,speed.lenmod_factor,speed.lenmod2_factor);
|
||||
#endif
|
||||
} // end of SetSpeed
|
||||
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
#include "translate.h"
|
||||
#include "wave.h"
|
||||
|
||||
const char *version_string = "1.48.13 04.Nov.14";
|
||||
const char *version_string = "1.48.14 01.Apr.15";
|
||||
const int version_phdata = 0x014801;
|
||||
|
||||
int option_device_number = -1;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 to 2014 by Jonathan Duddington *
|
||||
* Copyright (C) 2005 to 2015 by Jonathan Duddington *
|
||||
* email: jonsd@users.sourceforge.net *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -72,7 +72,7 @@
|
||||
#define OFFSET_ETHIOPIC 0x1200
|
||||
|
||||
|
||||
// character ranges must be listed in ascending order
|
||||
// character ranges must be listed in ascending unicode order
|
||||
ALPHABET alphabets [] = {
|
||||
{"_el", OFFSET_GREEK, 0x380, 0x3ff, L('e','l'), AL_DONT_NAME | AL_NOT_LETTERS | AL_WORDS},
|
||||
{"_cyr", OFFSET_CYRILLIC, 0x400, 0x52f, 0, 0},
|
||||
@@ -887,6 +887,7 @@ Translator *SelectTranslator(const char *name)
|
||||
case L('o','r'): // Oriya
|
||||
case L('p','a'): // Punjabi
|
||||
case L('g','u'): // Gujarati
|
||||
case L('m','r'): // Marathi
|
||||
{
|
||||
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 };
|
||||
@@ -1501,7 +1502,6 @@ SetLengthMods(tr,3); // all equal
|
||||
case L('t','a'): // Tamil
|
||||
case L('k','n'): // Kannada
|
||||
case L('m','l'): // Malayalam
|
||||
case L('m','r'): // Marathi
|
||||
case L('t','e'): // Telugu
|
||||
{
|
||||
SetupTranslator(tr,stress_lengths_ta2, stress_amps_ta);
|
||||
@@ -1682,7 +1682,9 @@ SetLengthMods(tr,3); // all equal
|
||||
{
|
||||
tr->langopts.textmode = 1;
|
||||
tr->langopts.listx = 1; // compile zh_listx after zh_list
|
||||
}
|
||||
tr->langopts.numbers = 1;
|
||||
tr->langopts.numbers2 = NUM2_ZERO_TENS;
|
||||
tr->langopts.break_numbers = 0x00018; }
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -527,6 +527,7 @@ typedef struct {
|
||||
#define NUM2_OMIT_1_HUNDRED_ONLY 0x20000
|
||||
#define NUM2_ORDINAL_AND_THOUSANDS 0x40000
|
||||
#define NUM2_ORDINAL_DROP_VOWEL 0x80000 // currently only for tens and units
|
||||
#define NUM2_ZERO_TENS 0x100000
|
||||
// bits 1-4 use variant form of numbers before thousands,millions,etc.
|
||||
// bits 6-8 use different forms of thousand, million, etc (M MA MB)
|
||||
// bit9=(LANG=rw) say "thousand" and "million" before its number, not after
|
||||
@@ -539,6 +540,7 @@ typedef struct {
|
||||
// bit17=(LANG=ml) omit "one" before hundred only if there are no previous digits
|
||||
// bit18=(LANG=ta) same variant for ordinals and thousands (#o = #a)
|
||||
// bit19=(LANG=te) drop final vowel from cardial number before adding ordinal suffix
|
||||
// bit20=(LANG=zh) say zero tens
|
||||
int numbers2;
|
||||
|
||||
#define BREAK_THOUSANDS 0x49249248
|
||||
|
||||
Reference in New Issue
Block a user