mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-07 15:24:02 +00:00
[1.26.08] Fixed --stdout option in "espeak" program was writing to file "stdout".
Fix to UTF-8/8-bit character set recognition. lang=de, more additions to translation rules, changed phoneme name [OI] to [OY]. lang=it, turned of "syntactic doubling" (temporarily?) git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@51 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+4
-4
@@ -183,8 +183,8 @@ static void Write4Bytes(FILE *f, int value)
|
||||
|
||||
|
||||
|
||||
int OpenWavFile(const char *path, int rate)
|
||||
//=========================================
|
||||
int OpenWavFile(char *path, int rate)
|
||||
//===================================
|
||||
{
|
||||
static unsigned char wave_hdr[44] = {
|
||||
'R','I','F','F',0,0,0,0,'W','A','V','E','f','m','t',' ',
|
||||
@@ -197,7 +197,7 @@ int OpenWavFile(const char *path, int rate)
|
||||
if(path[0] == 0)
|
||||
return(0);
|
||||
|
||||
if(path == "stdout")
|
||||
if(strcmp(path,"stdout")==0)
|
||||
f_wavfile = stdout;
|
||||
else
|
||||
f_wavfile = fopen(path,"wb");
|
||||
@@ -220,7 +220,7 @@ static void CloseWavFile(int rate)
|
||||
{
|
||||
unsigned int pos;
|
||||
|
||||
if((f_wavfile==NULL) || (wavefile == "stdout"))
|
||||
if((f_wavfile==NULL) || (f_wavfile == stdout))
|
||||
return;
|
||||
|
||||
fflush(f_wavfile);
|
||||
|
||||
@@ -1209,6 +1209,7 @@ if(control==2)
|
||||
|
||||
espeak_Initialize(AUDIO_OUTPUT_RETRIEVAL,1000,NULL,1);
|
||||
espeak_SetSynthCallback(TestSynthCallback);
|
||||
espeak_SetUriCallback(TestUriCallback);
|
||||
|
||||
unsigned int unique_identifier=0;
|
||||
int index=0;
|
||||
|
||||
+2
-2
@@ -300,7 +300,7 @@ static int GetC(void)
|
||||
if((c2 & 0xc0) != 0x80)
|
||||
{
|
||||
// This is not UTF8. Change to 8-bit characterset.
|
||||
if(n_bytes > 1)
|
||||
if((n_bytes == 2) && (ix == 1))
|
||||
ungot2 = cbuf[2];
|
||||
GetC_unget(c2);
|
||||
break;
|
||||
@@ -502,7 +502,7 @@ int Translator::AnnouncePunctuation(int c1, int c2, char *buf, int bufix)
|
||||
sprintf(p,"\001+10S%s",tone_punct_on);
|
||||
while(punct_count-- > 0)
|
||||
sprintf(buf,"%s %s",buf,punctname);
|
||||
sprintf(p,"%s %s\001S",buf,tone_punct_off);
|
||||
sprintf(p,"%s %s\001-10S",buf,tone_punct_off);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+1
-1
@@ -191,7 +191,7 @@ int SynthCallback(short *wav, int numsamples, espeak_EVENT *events);
|
||||
extern "C"
|
||||
#endif
|
||||
void espeak_SetUriCallback(int (*UriCallback)(int, const char*, const char*));
|
||||
/* This function must be called before synthesis functions are used, in order to deal with
|
||||
/* This function may be called before synthesis functions are used, in order to deal with
|
||||
<audio> tags. It specifies a callback function which is called when an <audio> element is
|
||||
encountered and allows the calling program to indicate whether the sound file which
|
||||
is specified in the <audio> element is available and is to be played.
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
#include "translate.h"
|
||||
#include "wave.h"
|
||||
|
||||
const char *version_string = "1.26.06 18.Jun.07";
|
||||
const char *version_string = "1.26.08 19.Jun.07";
|
||||
const int version_phdata = 0x012601;
|
||||
|
||||
int option_device_number = -1;
|
||||
|
||||
@@ -379,7 +379,7 @@ Translator *SelectTranslator(const char *name)
|
||||
tr->langopts.unstressed_wd1 = 2;
|
||||
tr->langopts.unstressed_wd2 = 2;
|
||||
tr->langopts.param[LOPT_IT_LENGTHEN] = 2; // remove lengthen indicator from unstressed or non-penultimate syllables
|
||||
tr->langopts.param[LOPT_IT_DOUBLING] = 2;
|
||||
// tr->langopts.param[LOPT_IT_DOUBLING] = 2;
|
||||
tr->langopts.param[LOPT_SONORANT_MIN] = 130; // limit the shortening of sonorants before short vowels
|
||||
tr->langopts.param[LOPT_REDUCE] = 1; // reduce vowels even if phonemes are specified in it_list
|
||||
tr->langopts.numbers = 0x2709;
|
||||
|
||||
@@ -758,6 +758,7 @@ if((wmark > 0) && (wmark < 8))
|
||||
char end_phonemes2[N_WORD_PHONEMES];
|
||||
|
||||
// remove any standard suffix and confirm that the prefix is still recognised
|
||||
phonemes2[0] = 0;
|
||||
end2 = TranslateRules(word, phonemes2, N_WORD_PHONEMES, end_phonemes2, wflags|FLAG_NO_PREFIX|FLAG_NO_TRACE, dictionary_flags);
|
||||
if(end2)
|
||||
{
|
||||
|
||||
+2
-1
@@ -227,7 +227,8 @@ extern const int param_defaults[N_SPEECH_PARAM];
|
||||
#define LOPT_LENGTH_MODS 6
|
||||
// increase this to prevent sonorants being shortened before shortened (eg. unstressed) vowels
|
||||
#define LOPT_SONORANT_MIN 7
|
||||
// Italian "syntactic doubling"
|
||||
// bit 0=Italian "syntactic doubling" of consoants in the word after a word marked with $double attribute
|
||||
// bit 1=also after a word which ends with a stressed vowel
|
||||
#define LOPT_IT_DOUBLING 8
|
||||
// max. amplitude for vowel at the end of a clause
|
||||
#define LOPT_MAXAMP_EOC 9
|
||||
|
||||
Reference in New Issue
Block a user