espeak 1.44.05 release version

Fix error in big-endian data conversion program, producing bad data.

Make geminated voiced stops (eg. [bb] ) longer at fast speeds.

Provide conditional compilation of the mbrola interface, define macro INCLUDE_MBROLA in speech.h

Mbrola: also look for mbrola voices in /usr/share/mbrola/voices

Pad TUNES and frame_t structures to a multiple of 4 bytes.

lang=da, Don't weaken unvoiced stops before pause.
lang=el, Remove final unstressed [a] if the next word starts with [a].
lang=pt, Change final [U] to [w] if next word starts with a vowel.


espeak 1.44.03

Fixes:
Lang=el, mk.  Was speaking words as individual letters.
Lang=pl.  Fix prounciation of 'ć' and 'ci'.
Fix crash in big-endian data conversion program.
Fix problem where changing voices reduces the speaking rate, at fast rates.

speak_lib.h:  add macro definitions for minimum, maximum, and normal speaking rate values.


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@253 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2010-09-15 14:03:05 +00:00
parent eb7b132e9a
commit 14e212f3a1
47 changed files with 1469 additions and 369 deletions
+3 -3
View File
@@ -1605,7 +1605,7 @@ int LoadSpect(const char *path, int control)
displ = ftell(f_phdata);
seq_out.n_frames=0;
seq_out.flags=0;
seq_out.sqflags=0;
seq_out.length_total=0;
total = 0;
@@ -1752,7 +1752,7 @@ for(ix=0; ix<8; ix++)
if(klatt_flag)
{
seqk_out.n_frames = seq_out.n_frames;
seqk_out.flags = seq_out.flags;
seqk_out.sqflags = seq_out.sqflags;
seqk_out.length_total = seq_out.length_total;
ix = (char *)(&seqk_out.frame[seqk_out.n_frames]) - (char *)(&seqk_out);
@@ -3613,7 +3613,7 @@ static const TUNE default_tune = {
PITCHfall, 64, 8,
PITCHfall, 70, 18, 24, 12,
PITCHfall, 70, 18, 24, 12, 0,
{0,0,0,0,0,0,0,0,0,0}
{0,0,0,0,0,0,0,0}, 0
};
#define N_TUNE_NAMES 100
+3 -2
View File
@@ -2621,6 +2621,9 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c
if(match1.points > 0)
{
if(word_flags & FLAG_UNPRON_TEST)
return(match1.end_type | 1);
if((match1.phonemes[0] == phonSWITCH) && ((word_flags & FLAG_DONT_SWITCH_TRANSLATOR)==0))
{
// an instruction to switch language, return immediately so we can re-translate
@@ -2628,8 +2631,6 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c
return(0);
}
if(word_flags & FLAG_UNPRON_TEST)
return(match1.end_type | 1);
match1.end_type &= ~SUFX_UNPRON;
if((match1.end_type != 0) && (end_phonemes != NULL))
+2
View File
@@ -247,6 +247,8 @@ END_EVENT_TABLE()
MyFrame::~MyFrame(void)
{//====================
myframe->Show(false);
myframe->Iconize(false); // os=Windows, get the non-iconsized size
myframe->GetPosition(&frame_x, &frame_y);
myframe->GetSize(&frame_w, &frame_h);
}
+5
View File
@@ -15,6 +15,9 @@
* GNU General Public License for more details.
*/
#include "speech.h"
#ifdef INCLUDE_MBROLA
#include <stdarg.h>
#include <stdio.h>
#include <unistd.h>
@@ -603,3 +606,5 @@ void resetError_MBR(void)
{
mbr_errorbuf[0] = 0;
}
#endif // INCLUDE_MBROLA
+11
View File
@@ -1343,6 +1343,7 @@ static int LookupNum3(Translator *tr, int value, char *ph_out, int suppress_null
int hundreds;
int tensunits;
int x;
int ix;
int exact;
int ordinal;
char string[12]; // for looking up entries in **_list
@@ -1500,6 +1501,16 @@ static int LookupNum3(Translator *tr, int value, char *ph_out, int suppress_null
ph_hundred_and[0] = 0; // don't put 'and' after 'hundred' if there's 'and' between tens and units
}
}
else
{
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
strcpy(buf2, ph_ordinal2);
}
}
sprintf(ph_out,"%s%s%s",buf1,ph_hundred_and,buf2);
+4 -4
View File
@@ -889,13 +889,13 @@ static int AnnouncePunctuation(Translator *tr, int c1, int *c2_ptr, char *output
else
if(punct_count < 4)
{
sprintf(buf,"\001+15S");
sprintf(buf,"\001+10S");
while(punct_count-- > 0)
{
sprintf(buf2," %s",punctname);
strcat(buf, buf2);
}
sprintf(buf2," \001-15S");
sprintf(buf2," \001-10S");
strcat(buf, buf2);
}
else
@@ -1482,8 +1482,8 @@ static void SetProsodyParameter(int param_type, wchar_t *attr1, PARAM_STACK *sp)
{"x-slow",60},
{"slow",80},
{"medium",100},
{"fast",120},
{"x-fast",150},
{"fast",125},
{"x-fast",160},
{NULL, -1}};
static const MNEM_TAB mnem_pitch[] = {
+1 -1
View File
@@ -154,7 +154,7 @@ void SetSpeed(int control)
if(wpm > 1000)
{
// TESTING
test = wpm / 1000;
// test = wpm / 1000;
wpm = wpm % 1000;
}
#endif
+10 -2
View File
@@ -28,7 +28,7 @@
#include <stdio.h>
#include <stddef.h>
#define ESPEAK_API_REVISION 5
#define ESPEAK_API_REVISION 6
/*
Revision 2
Added parameter "options" to eSpeakInitialize()
@@ -41,11 +41,19 @@ Revision 4
Revision 5
Added espeakCHARS_16BIT
Revision 6
Added macros: espeakRATE_MINIMUM, espeakRATE_MAXIMUM, espeakRATE_NORMAL
*/
/********************/
/* Initialization */
/********************/
// values for 'value' in espeak_SetParameter(espeakRATE, value, 0), nominally in words-per-minute
#define espeakRATE_MINIMUM 80
#define espeakRATE_MAXIMUM 450
#define espeakRATE_NORMAL 175
typedef enum {
espeakEVENT_LIST_TERMINATED = 0, // Retrieval mode: terminates the event list.
@@ -386,7 +394,7 @@ espeak_ERROR espeak_SetParameter(espeak_PARAMETER parameter, int value, int rela
relative=1 Sets a relative value of the parameter.
parameter:
espeakRATE: speaking speed in word per minute.
espeakRATE: speaking speed in word per minute. Values 80 to 450.
espeakVOLUME: volume in range 0-200 or more.
0=silence, 100=normal full volume, greater values may produce amplitude compression or distortion
+1
View File
@@ -22,6 +22,7 @@
// conditional compilation options
#define INCLUDE_KLATT
#define INCLUDE_MBROLA
#if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN
#define ARCH_BIG
+37 -1
View File
@@ -17,6 +17,8 @@
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "StdAfx.h"
#include <stdio.h>
@@ -33,6 +35,10 @@
#include "translate.h"
#include "voice.h"
int option_mbrola_phonemes;
#ifdef INCLUDE_MBROLA
extern int Read4Bytes(FILE *f);
extern void SetPitch2(voice_t *voice, int pitch1, int pitch2, int *pitch_base, int *pitch_range);
extern unsigned char *outbuf;
@@ -103,7 +109,6 @@ void unload_MBR()
static MBROLA_TAB *mbrola_tab = NULL;
static int mbrola_control = 0;
int option_mbrola_phonemes;
espeak_ERROR LoadMbrolaTable(const char *mbrola_voice, const char *phtrans, int srate)
@@ -133,6 +138,11 @@ espeak_ERROR LoadMbrolaTable(const char *mbrola_voice, const char *phtrans, int
// mbrola voice file not found, look in /usr/share
sprintf(path,"/usr/share/mbrola/%s",mbrola_voice);
}
if(GetFileLength(path) <= 0)
{
// mbrola voice file not found, look in /usr/share
sprintf(path,"/usr/share/mbrola/voices/%s",mbrola_voice);
}
#endif
#ifdef PLATFORM_WINDOWS
if(load_MBR() == FALSE) // load mbrola.dll
@@ -639,3 +649,29 @@ void MbrolaReset(void)
reset_MBR();
}
#else // INCLUDE_MBROLA
// mbrola interface is not compiled, provide dummy functions.
espeak_ERROR LoadMbrolaTable(const char *mbrola_voice, const char *phtrans, int srate)
{
return(EE_INTERNAL_ERROR);
}
int MbrolaGenerate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
{
return(0);
}
int MbrolaFill(int length, int resume)
{
return(0);
}
void MbrolaReset(void)
{
}
#endif // INCLUDE_MBROLA
+2 -2
View File
@@ -35,8 +35,8 @@
#include "translate.h"
#include "wave.h"
const char *version_string = "1.44.02 13.Aug.10";
const int version_phdata = 0x014400;
const char *version_string = "1.44.04 14.Sep.10";
const int version_phdata = 0x014404;
int option_device_number = -1;
FILE *f_logespeak = NULL;
+1 -1
View File
@@ -1469,7 +1469,7 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
DoSpect2(ph, 0, &fmtp, p, 0);
if(p->synthflags & SFLAG_LENGTHEN)
{
DoPause(20,0);
DoPause(25,1);
DoSpect2(ph, 0, &fmtp, p, 0);
}
}
+8 -30
View File
@@ -89,7 +89,7 @@ extern int embedded_default[N_EMBEDDED_VALUES];
typedef struct { // 44 bytes
typedef struct { // 64 bytes
short frflags;
short ffreq[7];
unsigned char length;
@@ -102,8 +102,10 @@ typedef struct { // 44 bytes
unsigned char klattp2[5]; // continuation of klattp[], Avp, Fric, FricBP, Turb
unsigned char klatt_ap[7]; // Klatt parallel amplitude
unsigned char klatt_bp[7]; // Klatt parallel bandwidth /2
unsigned char spare; // pad to multiple of 4 bytes
} frame_t; // with extra Klatt parameters for parallel resonators
typedef struct { // 44 bytes
short frflags;
short ffreq[7];
@@ -114,32 +116,7 @@ typedef struct { // 44 bytes
unsigned char fright[3]; // width/4 f0-2
unsigned char bw[4]; // Klatt bandwidth BNZ /2, f1,f2,f3
unsigned char klattp[5]; // AV, FNZ, Tilt, Aspr, Skew
} frame_t2; // TESTING
#ifdef deleted
typedef struct {
short frflags;
unsigned char length;
unsigned char rms;
short ffreq[9];
unsigned char fheight[9];
unsigned char fwidth[6]; // width/4
unsigned char fright[6]; // width/4
unsigned char fwidth6, fright6;
unsigned char klattp[N_KLATTP];
} frame_t;
typedef struct { // 43 bytes
short frflags;
unsigned char length;
unsigned char rms;
short ffreq[9];
unsigned char fheight[9];
unsigned char fwidth[6]; // width/4
unsigned char fright[6]; // width/4
} frame_t2; // the original, without Klatt additions, used for file "phondata"
#endif
} frame_t2; // without the extra Klatt parameters
@@ -193,14 +170,14 @@ typedef struct {
typedef struct {
short length_total; // not used
unsigned char n_frames;
unsigned char flags;
unsigned char sqflags;
frame_t2 frame[N_SEQ_FRAMES]; // max. frames in a spectrum sequence
} SPECT_SEQ; // sequence of espeak formant frames
typedef struct {
short length_total; // not used
unsigned char n_frames;
unsigned char flags;
unsigned char sqflags;
frame_t frame[N_SEQ_FRAMES]; // max. frames in a spectrum sequence
} SPECT_SEQK; // sequence of klatt formants frames
@@ -433,7 +410,8 @@ typedef struct {
unsigned char split_tail_end;
unsigned char split_tune;
unsigned char spare[10];
unsigned char spare[8];
int spare2; // the struct length should be a multiple of 4 bytes
} TUNE;
extern int n_tunes;
+3 -2
View File
@@ -883,7 +883,7 @@ SetLengthMods(tr,3); // all equal
SetupTranslator(tr,stress_lengths_mk,stress_amps_mk);
tr->charset_a0 = charsets[5]; // ISO-8859-5
tr->letter_groups[0] = vowels_cyrillic;
tr->letter_groups[0] = tr->letter_groups[7] = vowels_cyrillic;
tr->langopts.stress_rule = STRESSPOSN_3R; // antipenultimate
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_AND_UNITS | NUM_OMIT_1_HUNDRED | NUM_OMIT_1_THOUSAND | NUM_DFRACTION_2;
@@ -1037,6 +1037,7 @@ SetLengthMods(tr,3); // all equal
tr->langopts.stress_flags = 0x20;
tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x13;
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_SWAP_TENS | NUM_OMIT_1_HUNDRED | NUM_DFRACTION_2 | NUM_ORDINAL_DOT | NUM_ROMAN;
tr->langopts.numbers2 = 0x100; // plural forms of millions etc
tr->langopts.thousands_sep = ' '; // don't allow dot as thousands separator
SetLetterVowel(tr,'r');
break;
@@ -1192,7 +1193,7 @@ SetLengthMods(tr,3); // all equal
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.word_gap = 0x21; // length of a final vowel is less dependent on the next consonant, don't merge consonant with next word
// tr->langopts.vowel_pause = 4;
tr->letter_groups[0] = vowels_vi;
tr->letter_groups[0] = tr->letter_groups[7] = vowels_vi;
tr->langopts.tone_language = 1; // Tone language, use CalcPitches_Tone() rather than CalcPitches()
tr->langopts.unstressed_wd1 = 2;
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_HUNDRED_AND | NUM_DFRACTION_4;
+6 -1
View File
@@ -1705,7 +1705,7 @@ static int TranslateWord2(Translator *tr, char *word, WORD_TAB *wtab, int pre_pa
return(flags);
}
if(flags & FLAG_COMBINE)
if((flags & FLAG_COMBINE) && !(wtab[1].flags & FLAG_PHONEMES))
{
char *p2;
int ok = 1;
@@ -1807,6 +1807,7 @@ static int TranslateWord2(Translator *tr, char *word, WORD_TAB *wtab, int pre_pa
// ?? Option to set the word-stress according to language1 rules eg. lang=fr)
if(ChangeEquivalentPhonemes(tr, switch_phonemes, (char *)p))
{
// Phonemes have been converted from the foreign language to the native language
switch_phonemes = -1;
}
@@ -1814,6 +1815,10 @@ static int TranslateWord2(Translator *tr, char *word, WORD_TAB *wtab, int pre_pa
{
strcpy(dictionary_name, old_dictionary_name);
SelectPhonemeTable(voice->phoneme_tab_ix);
// leave switch_phonemes set, but use the original phoneme table number.
// This will suppress LOPT_REGRESSIVE_VOICING
switch_phonemes = voice->phoneme_tab_ix; // original phoneme table
}
}
+6 -3
View File
@@ -921,7 +921,10 @@ voice_t *LoadVoice(const char *vname, int control)
phtrans[0] = 0;
sscanf(p,"%s %s %d",name,phtrans,&srate);
LoadMbrolaTable(name,phtrans,srate);
if(LoadMbrolaTable(name,phtrans,srate) != EE_OK)
{
fprintf(stderr,"mbrola voice not found\n");
}
voice->samplerate = srate;
}
break;
@@ -934,7 +937,7 @@ voice_t *LoadVoice(const char *vname, int control)
case V_FAST:
Read8Numbers(p,speed.fast_settings);
SetSpeed(2);
SetSpeed(3);
break;
default:
@@ -958,7 +961,7 @@ voice_t *LoadVoice(const char *vname, int control)
new_translator = SelectTranslator(translator_name);
}
SetSpeed(1); // for speed_percent
SetSpeed(3); // for speed_percent
for(ix=0; ix<N_PEAKS; ix++)
{
+1 -1
View File
@@ -133,7 +133,7 @@ int wcmdq_head=0;
int wcmdq_tail=0;
// pitch,speed,
int embedded_default[N_EMBEDDED_VALUES] = {0,50,175,100,50, 0,0, 0,175,0,0,0,0,0,0};
int embedded_default[N_EMBEDDED_VALUES] = {0, 50,175,100,50, 0, 0, 0,175,0,0,0,0,0,0};
static int embedded_max[N_EMBEDDED_VALUES] = {0,0x7fff,600,300,99,99,99, 0,600,0,0,0,0,4,0};
#define N_CALLBACK_IX N_WAV_BUF-2 // adjust this delay to match display with the currently spoken word