diff --git a/src/libespeak-ng/intonation.c b/src/libespeak-ng/intonation.c index 074516a0..1a9e1240 100644 --- a/src/libespeak-ng/intonation.c +++ b/src/libespeak-ng/intonation.c @@ -289,18 +289,6 @@ static TONE_NUCLEUS tone_nucleus_table[N_TONE_NUCLEUS_TABLE] = { { PITCHfall, 70, 18, PITCHfall, 70, 24, NULL, 32, 20, 0 }, // 12 test }; -// index by 0=. 1=, 2=?, 3=! 4=none, 5=emphasized -unsigned char punctuation_to_tone[INTONATION_TYPES][PUNCT_INTONATIONS] = { - { 0, 1, 2, 3, 0, 4 }, - { 0, 1, 2, 3, 0, 4 }, - { 5, 6, 2, 3, 0, 4 }, - { 5, 7, 1, 3, 0, 4 }, - { 8, 9, 10, 3, 0, 0 }, - { 8, 8, 10, 3, 0, 0 }, - { 11, 11, 11, 11, 0, 0 }, // 6 test - { 12, 12, 12, 12, 0, 0 } -}; - int n_tunes = 0; TUNE *tunes = NULL; diff --git a/src/libespeak-ng/readclause.c b/src/libespeak-ng/readclause.c index aa884d59..193a64f2 100644 --- a/src/libespeak-ng/readclause.c +++ b/src/libespeak-ng/readclause.c @@ -132,24 +132,6 @@ int clause_type_from_codepoint(uint32_t c) return CLAUSE_NONE; } -const int param_defaults[N_SPEECH_PARAM] = { - 0, // silence (internal use) - 175, // rate wpm - 100, // volume - 50, // pitch - 50, // range - 0, // punctuation - 0, // capital letters - 0, // wordgap - 0, // options - 0, // intonation - 0, - 0, - 0, // emphasis - 0, // line length - 0, // voice type -}; - int towlower2(unsigned int c) { // check for non-standard upper to lower case conversions diff --git a/src/libespeak-ng/readclause.h b/src/libespeak-ng/readclause.h index 3a1bb37e..ca8789dc 100644 --- a/src/libespeak-ng/readclause.h +++ b/src/libespeak-ng/readclause.h @@ -33,7 +33,6 @@ typedef struct { } PARAM_STACK; extern PARAM_STACK param_stack[]; -extern const int param_defaults[N_SPEECH_PARAM]; int clause_type_from_codepoint(uint32_t c); int towlower2(unsigned int c); // Supports Turkish I diff --git a/src/libespeak-ng/setlengths.c b/src/libespeak-ng/setlengths.c index 3149e947..f7d8b104 100644 --- a/src/libespeak-ng/setlengths.c +++ b/src/libespeak-ng/setlengths.c @@ -377,6 +377,7 @@ espeak_ng_STATUS SetParameter(int parameter, int value, int relative) int new_value = value; int default_value; + extern const int *param_defaults; if (relative) { if (parameter < 5) { diff --git a/src/libespeak-ng/setlengths.h b/src/libespeak-ng/setlengths.h index 7835c68f..07624e2e 100644 --- a/src/libespeak-ng/setlengths.h +++ b/src/libespeak-ng/setlengths.h @@ -30,6 +30,11 @@ extern "C" void CalcLengths(Translator *tr); +espeak_ng_STATUS SetParameter(int parameter, + int value, + int relative + ); + #ifdef __cplusplus } #endif diff --git a/src/libespeak-ng/speech.c b/src/libespeak-ng/speech.c index 31c64fa5..32511845 100644 --- a/src/libespeak-ng/speech.c +++ b/src/libespeak-ng/speech.c @@ -333,6 +333,25 @@ ESPEAK_NG_API void espeak_ng_InitializePath(const char *path) strcpy(path_home, PATH_ESPEAK_DATA); } +const int param_defaults[N_SPEECH_PARAM] = { + 0, // silence (internal use) + 175, // rate wpm + 100, // volume + 50, // pitch + 50, // range + 0, // punctuation + 0, // capital letters + 0, // wordgap + 0, // options + 0, // intonation + 0, + 0, + 0, // emphasis + 0, // line length + 0, // voice type +}; + + ESPEAK_NG_API espeak_ng_STATUS espeak_ng_Initialize(espeak_ng_ERROR_CONTEXT *context) { int param; @@ -919,6 +938,7 @@ ESPEAK_NG_API espeak_ng_STATUS espeak_ng_Terminate(void) return ENS_OK; } +const char *version_string = PACKAGE_VERSION; ESPEAK_API const char *espeak_Info(const char **ptr) { if (ptr != NULL) diff --git a/src/libespeak-ng/synth_mbrola.c b/src/libespeak-ng/synth_mbrola.c index 203c95b5..29ba6599 100644 --- a/src/libespeak-ng/synth_mbrola.c +++ b/src/libespeak-ng/synth_mbrola.c @@ -35,6 +35,7 @@ #include "dictionary.h" #include "mbrola.h" #include "readclause.h" +#include "setlengths.h" #include "synthdata.h" #include "wavegen.h" diff --git a/src/libespeak-ng/synthdata.c b/src/libespeak-ng/synthdata.c index ac73a2d9..7cee6996 100644 --- a/src/libespeak-ng/synthdata.c +++ b/src/libespeak-ng/synthdata.c @@ -41,7 +41,6 @@ #include "synthesize.h" #include "translate.h" -const char *version_string = PACKAGE_VERSION; const int version_phdata = 0x014801; // copy the current phoneme table into here diff --git a/src/libespeak-ng/synthesize.h b/src/libespeak-ng/synthesize.h index da2c88b2..ef99b371 100644 --- a/src/libespeak-ng/synthesize.h +++ b/src/libespeak-ng/synthesize.h @@ -480,7 +480,6 @@ extern unsigned char *out_start; extern unsigned char *out_end; extern espeak_EVENT *event_list; extern t_espeak_callback *synth_callback; -extern const char *version_string; extern const int version_phdata; #define N_SOUNDICON_TAB 80 // total entries in soundicon_tab @@ -488,7 +487,6 @@ extern const int version_phdata; extern int n_soundicon_tab; extern SOUND_ICON soundicon_tab[N_SOUNDICON_TAB]; -espeak_ng_STATUS SetParameter(int parameter, int value, int relative); void DoEmbedded(int *embix, int sourceix); void DoMarker(int type, int char_posn, int length, int value); void DoPhonemeMarker(int type, int char_posn, int length, char *name); diff --git a/src/libespeak-ng/tr_languages.c b/src/libespeak-ng/tr_languages.c index 2886f16a..bfacb5a5 100644 --- a/src/libespeak-ng/tr_languages.c +++ b/src/libespeak-ng/tr_languages.c @@ -294,6 +294,18 @@ static Translator *NewTranslator(void) tr->langopts.break_numbers = BREAK_THOUSANDS; // 1000, 1000,000 1,000,000 etc tr->langopts.max_digits = 14; + // index by 0=. 1=, 2=?, 3=! 4=none, 5=emphasized + unsigned char punctuation_to_tone[INTONATION_TYPES][PUNCT_INTONATIONS] = { + { 0, 1, 2, 3, 0, 4 }, + { 0, 1, 2, 3, 0, 4 }, + { 5, 6, 2, 3, 0, 4 }, + { 5, 7, 1, 3, 0, 4 }, + { 8, 9, 10, 3, 0, 0 }, + { 8, 8, 10, 3, 0, 0 }, + { 11, 11, 11, 11, 0, 0 }, // 6 test + { 12, 12, 12, 12, 0, 0 } + }; + memcpy(tr->punct_to_tone, punctuation_to_tone, sizeof(tr->punct_to_tone)); memcpy(tr->langopts.tunes, default_tunes, sizeof(tr->langopts.tunes)); diff --git a/src/libespeak-ng/translate.h b/src/libespeak-ng/translate.h index 428c2ac4..08e36f18 100644 --- a/src/libespeak-ng/translate.h +++ b/src/libespeak-ng/translate.h @@ -669,7 +669,6 @@ extern char skip_marker[N_MARKER_LENGTH]; #define N_PUNCTLIST 60 extern wchar_t option_punctlist[N_PUNCTLIST]; // which punctuation characters to announce -extern unsigned char punctuation_to_tone[INTONATION_TYPES][PUNCT_INTONATIONS]; extern Translator *translator; extern Translator *translator2;