[1.48.11]

Command-line: added options --sep --tie.

API, changed the meaning of the "phonememode" parameter in espeak_SetPhonemeTrace() and espeak_TextToPhonemes().

Language changes to:  en, eu, pt.


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@385 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2014-08-31 15:50:07 +00:00
parent 2315736555
commit b27f69bb5a
33 changed files with 1151 additions and 769 deletions
+52 -13
View File
@@ -87,7 +87,7 @@ static const char *help_text =
"-p <integer>\n"
"\t Pitch adjustment, 0 to 99, default is 50\n"
"-s <integer>\n"
"\t Speed in words per minute, 80 to 450, default is 175\n"
"\t Speed in approximate words per minute. The default is 175\n"
"-v <voice name>\n"
"\t Use voice file of this name from espeak-data/voices\n"
"-w <wave file name>\n"
@@ -102,7 +102,6 @@ static const char *help_text =
"\t Compile pronunciation rules and dictionary from the current\n"
"\t directory. <voice name> specifies the language\n"
"--ipa Write phonemes to stdout using International Phonetic Alphabet\n"
"\t --ipa=1 Use ties, --ipa=2 Use ZWJ, --ipa=3 Separate with _\n"
"--path=\"<path>\"\n"
"\t Specifies the directory containing the espeak-data directory\n"
"--pho Write mbrola phoneme data (.pho) to stdout or to the file in --phonout\n"
@@ -111,9 +110,15 @@ static const char *help_text =
"--punct=\"<characters>\"\n"
"\t Speak the names of punctuation characters during speaking. If\n"
"\t =<characters> is omitted, all punctuation is spoken.\n"
"--split=\"<minutes>\"\n"
"--sep=<character>\n"
"\t Separate phonemes (from -x --ipa) with <character>.\n"
"\t Default is space, z means ZWJN character.\n"
"--split=<minutes>\n"
"\t Starts a new WAV file every <minutes>. Used with -w\n"
"--stdout Write speech output to stdout\n"
"--tie=<character>\n"
"\t Use a tie character within multi-letter phoneme names.\n"
"\t Default is U+361, z means ZWJ character.\n"
"--version Shows version number and date, and location of espeak-data\n"
"--voices=<language>\n"
"\t List the available voices for the specified language.\n"
@@ -496,6 +501,8 @@ int main (int argc, char **argv)
{"pho", no_argument, 0, 0x109},
{"ipa", optional_argument, 0, 0x10a},
{"version", no_argument, 0, 0x10b},
{"sep", optional_argument, 0, 0x10c},
{"tie", optional_argument, 0, 0x10d},
{0, 0, 0, 0}
};
@@ -516,6 +523,8 @@ int main (int argc, char **argv)
int flag_stdin = 0;
int flag_compile = 0;
int pitch_adjustment = 50;
int phoneme_options = 0;
int phonemes_separator = 0;
espeak_VOICE voice_select;
char filename[200];
char voicename[40];
@@ -622,11 +631,11 @@ int main (int argc, char **argv)
break;
case 'x':
option_phonemes = 1;
phoneme_options |= espeakPHONEMES_SHOW;
break;
case 'X':
option_phonemes = 2;
phoneme_options |= espeakPHONEMES_TRACE;
break;
case 'm':
@@ -729,21 +738,29 @@ int main (int argc, char **argv)
break;
case 0x109: // --pho
option_mbrola_phonemes = 16;
phoneme_options |= espeakPHONEMES_MBROLA;
break;
case 0x10a: // --ipa
option_phonemes = 3;
phoneme_options |= espeakPHONEMES_IPA;
if(optarg2 != NULL)
{
value = -1;
sscanf(optarg2,"%d",&value);
if((value<0) || (value>3))
// deprecated and obsolete
switch(atoi(optarg2))
{
fprintf(stderr,"Bad value for -ipa=\n");
value = 0;
case 1:
phonemes_separator = '_';
break;
case 2:
phonemes_separator = 0x0361;
phoneme_options |= espeakPHONEMES_TIE;
break;
case 3:
phonemes_separator = 0x200d; // ZWJ
phoneme_options |= espeakPHONEMES_TIE;
break;
}
option_phonemes += value;
}
break;
@@ -751,6 +768,26 @@ int main (int argc, char **argv)
init_path(argv[0],data_path);
printf("speak text-to-speech: %s Data at: %s\n",version_string,path_home);
exit(0);
case 0x10c: // --sep
phoneme_options |= espeakPHONEMES_SHOW;
if(optarg2 == 0)
phonemes_separator = ' ';
else
utf8_in(&phonemes_separator, optarg2);
if(phonemes_separator == 'z')
phonemes_separator = 0x200c; // ZWNJ
break;
case 0x10d: // --tie
phoneme_options |= (espeakPHONEMES_SHOW | espeakPHONEMES_TIE);
if(optarg2 == 0)
phonemes_separator = 0x0361; // default: combining-double-inverted-breve
else
utf8_in(&phonemes_separator, optarg2);
if(phonemes_separator == 'z')
phonemes_separator = 0x200d; // ZWJ
break;
default:
exit(0);
@@ -803,6 +840,8 @@ int main (int argc, char **argv)
SetParameter(espeakPUNCTUATION,option_punctuation,0);
SetParameter(espeakWORDGAP,wordgap,0);
option_phonemes = phoneme_options | (phonemes_separator << 8);
if(pitch_adjustment != 50)
{
SetParameter(espeakPITCH,pitch_adjustment,0);