diff --git a/src/libespeak-ng/compiledata.c b/src/libespeak-ng/compiledata.c index 61519346..0d26cab5 100644 --- a/src/libespeak-ng/compiledata.c +++ b/src/libespeak-ng/compiledata.c @@ -381,7 +381,6 @@ typedef struct CompileContext { int duplicate_references; int count_frames; int error_count; - int resample_count; int then_count; bool after_if; @@ -1104,9 +1103,9 @@ static int LoadWavefile(CompileContext *ctx, FILE *f, const char *fname) sr2 = Read4Bytes(f); fseek(f, 40, SEEK_SET); - if ((sr1 != samplerate_native) || (sr2 != sr1*2)) { - if (sr1 != samplerate_native) - error(ctx, "Can't resample (%d to %d): %s", sr1, samplerate_native, fname); + if ((sr1 != samplerate) || (sr2 != sr1*2)) { + if (sr1 != samplerate) + error(ctx, "Can't resample (%d to %d): %s", sr1, samplerate, fname); else error(ctx, "WAV file is not mono: %s", fname); return 0; @@ -2198,6 +2197,7 @@ static void WritePhonemeTables(CompileContext *ctx) static void EndPhonemeTable(CompileContext *ctx) { int ix; + char buf[5]; if (ctx->n_phoneme_tabs == 0) return; @@ -2206,7 +2206,7 @@ static void EndPhonemeTable(CompileContext *ctx) for (ix = 0; ix < ctx->n_phcodes; ix++) { if (ctx->phoneme_tab2[ix].type == phINVALID) { error(ctx, "Phoneme [%s] not declared, referenced at line %d", - WordToString(ctx->phoneme_tab2[ix].mnemonic), (int)(ctx->phoneme_tab2[ix].program)); + WordToString(buf, ctx->phoneme_tab2[ix].mnemonic), (int)(ctx->phoneme_tab2[ix].program)); ctx->error_count++; ctx->phoneme_tab2[ix].type = 0; // prevent the error message repeating } @@ -2371,7 +2371,7 @@ espeak_ng_CompilePhonemeDataPath(long rate, sprintf(phdst, "%s", path_home); } - samplerate_native = samplerate = rate; + samplerate = rate; LoadPhData(NULL, NULL); if (LoadVoice("", 8/*compiling phonemes*/) == NULL) { clean_context(ctx); @@ -2382,7 +2382,6 @@ espeak_ng_CompilePhonemeDataPath(long rate, WavegenSetVoice(voice); ctx->error_count = 0; - ctx->resample_count = 0; ctx->f_errors = log; strncpy0(ctx->current_fname, "phonemes", sizeof(ctx->current_fname)); @@ -2451,7 +2450,7 @@ espeak_ng_CompilePhonemeDataPath(long rate, // write a word so that further data doesn't start at displ=0 Write4Bytes(ctx->f_phdata, version_phdata); - Write4Bytes(ctx->f_phdata, samplerate_native); + Write4Bytes(ctx->f_phdata, samplerate); Write4Bytes(ctx->f_phindex, version_phdata); memset(ctx->ref_hash_tab, 0, sizeof(ctx->ref_hash_tab)); @@ -2483,11 +2482,7 @@ espeak_ng_CompilePhonemeDataPath(long rate, WavegenFini(); - if (ctx->resample_count > 0) { - fprintf(ctx->f_errors, "\n%d WAV files resampled to %d Hz\n", ctx->resample_count, samplerate_native); - fprintf(log, "Compiled phonemes: %d errors, %d files resampled to %d Hz.\n", ctx->error_count, ctx->resample_count, samplerate_native); - } else - fprintf(log, "Compiled phonemes: %d errors.\n", ctx->error_count); + fprintf(log, "Compiled phonemes: %d errors.\n", ctx->error_count); if (ctx->f_errors != stderr && ctx->f_errors != stdout) fclose(ctx->f_errors); diff --git a/src/libespeak-ng/dictionary.c b/src/libespeak-ng/dictionary.c index 14776904..1f835dbc 100644 --- a/src/libespeak-ng/dictionary.c +++ b/src/libespeak-ng/dictionary.c @@ -2084,6 +2084,7 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c int ix; unsigned int digit_count = 0; char *p; + char word_buf[5]; const ALPHABET *alphabet; int dict_flags0 = 0; MatchRecord match1 = { 0 }; @@ -2240,12 +2241,12 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c if (((alphabet = AlphabetFromChar(letter)) != NULL) && (alphabet->offset != tr->letter_bits_offset)) { if (tr->langopts.alt_alphabet == alphabet->offset) { - sprintf(phonemes, "%c%s", phonSWITCH, WordToString2(tr->langopts.alt_alphabet_lang)); + sprintf(phonemes, "%c%s", phonSWITCH, WordToString2(word_buf, tr->langopts.alt_alphabet_lang)); return 0; } if (alphabet->flags & AL_WORDS) { // switch to the nominated language for this alphabet - sprintf(phonemes, "%c%s", phonSWITCH, WordToString2(alphabet->language)); + sprintf(phonemes, "%c%s", phonSWITCH, WordToString2(word_buf, alphabet->language)); return 0; } } diff --git a/src/libespeak-ng/phoneme.h b/src/libespeak-ng/phoneme.h index 325a16d6..470d31dd 100644 --- a/src/libespeak-ng/phoneme.h +++ b/src/libespeak-ng/phoneme.h @@ -249,7 +249,6 @@ phoneme_add_feature(PHONEME_TAB *phoneme, // Several phoneme tables may be loaded into memory. phoneme_tab points to // one for the current voice extern int n_phoneme_tab; -extern int current_phoneme_table; extern PHONEME_TAB *phoneme_tab[N_PHONEME_TAB]; typedef struct { diff --git a/src/libespeak-ng/readclause.c b/src/libespeak-ng/readclause.c index 47c63a4d..d287e028 100644 --- a/src/libespeak-ng/readclause.c +++ b/src/libespeak-ng/readclause.c @@ -47,7 +47,7 @@ #include "ssml.h" // for SSML_STACK, ProcessSsmlTag, N_PARAM... #include "synthdata.h" // for SelectPhonemeTable #include "translate.h" // for Translator, utf8_out, CLAUSE_OPTION... -#include "voice.h" // for voice, voice_t, current_voice_selected +#include "voice.h" // for voice, voice_t, espeak_GetCurrentVoice #define N_XML_BUF 500 @@ -167,15 +167,12 @@ static void UngetC(int c) ungot_char = c; } -const char *WordToString2(unsigned int word) +const char *WordToString2(char buf[5], unsigned int word) { // Convert a language mnemonic word into a string int ix; - static char buf[5]; char *p; - MAKE_MEM_UNDEFINED(&buf, sizeof(buf)); - p = buf; for (ix = 3; ix >= 0; ix--) { if ((*p = word >> (ix*8)) != 0) @@ -199,7 +196,7 @@ static const char *LookupSpecial(Translator *tr, const char *string, char *text_ return NULL; } -static const char *LookupCharName(Translator *tr, int c, bool only) +static const char *LookupCharName(char buf[60], Translator *tr, int c, bool only) { // Find the phoneme string (in ascii) to speak the name of character c // Used for punctuation characters and symbols @@ -210,9 +207,6 @@ static const char *LookupCharName(Translator *tr, int c, bool only) char phonemes[60]; const char *lang_name = NULL; char *string; - static char buf[60]; - - MAKE_MEM_UNDEFINED(&buf, sizeof(buf)); buf[0] = 0; flags[0] = 0; @@ -284,6 +278,7 @@ static int AnnouncePunctuation(Translator *tr, int c1, int *c2_ptr, char *output int bufix1; char buf[200]; char ph_buf[30]; + char cn_buf[60]; c2 = *c2_ptr; buf[0] = 0; @@ -298,7 +293,7 @@ static int AnnouncePunctuation(Translator *tr, int c1, int *c2_ptr, char *output punctname = ph_buf; // use word for 'period' instead of 'dot' } if (punctname == NULL) - punctname = LookupCharName(tr, c1, false); + punctname = LookupCharName(cn_buf, tr, c1, false); if (punctname == NULL) return -1; @@ -419,7 +414,7 @@ void SetVoiceStack(espeak_VOICE *v, const char *variant_name) if (variant_name[0] == '!' && variant_name[1] == 'v' && variant_name[2] == PATHSEP) variant_name += 3; // strip variant directory name, !v plus PATHSEP strncpy0(base_voice_variant_name, variant_name, sizeof(base_voice_variant_name)); - memcpy(&base_voice, ¤t_voice_selected, sizeof(base_voice)); + memcpy(&base_voice, espeak_GetCurrentVoice(), sizeof(base_voice)); } static void RemoveChar(char *p) @@ -833,7 +828,8 @@ int ReadClause(Translator *tr, char *buf, short *charix, int *charix_top, int n_ char *p2; p2 = &buf[ix]; - sprintf(p2, "%s", LookupCharName(tr, c1, true)); + char cn_buf[60]; + sprintf(p2, "%s", LookupCharName(cn_buf, tr, c1, true)); if (p2[0] != 0) { ix += strlen(p2); announced_punctuation = c1; @@ -1020,6 +1016,7 @@ static void DecodeWithPhonemeMode(char *buf, char *phonemes, Translator *tr, Tra } else { SetWordStress(tr2, phonemes, flags, -1, 0); DecodePhonemes(phonemes, phonemes2); - sprintf(buf, "[\002_^_%s %s _^_%s]]", ESPEAKNG_DEFAULT_VOICE, phonemes2, WordToString2(tr->translator_name)); + char wbuf[5]; + sprintf(buf, "[\002_^_%s %s _^_%s]]", ESPEAKNG_DEFAULT_VOICE, phonemes2, WordToString2(wbuf, tr->translator_name)); } -} \ No newline at end of file +} diff --git a/src/libespeak-ng/readclause.h b/src/libespeak-ng/readclause.h index e55235ea..cd5cd4b0 100644 --- a/src/libespeak-ng/readclause.h +++ b/src/libespeak-ng/readclause.h @@ -36,7 +36,7 @@ extern PARAM_STACK param_stack[]; int clause_type_from_codepoint(uint32_t c); int Eof(void); -const char *WordToString2(unsigned int word); +const char *WordToString2(char buf[5], unsigned int word); int AddNameData(const char *name, int wide); int ReadClause(Translator *tr, diff --git a/src/libespeak-ng/speech.c b/src/libespeak-ng/speech.c index a3fa3c01..befbb35e 100644 --- a/src/libespeak-ng/speech.c +++ b/src/libespeak-ng/speech.c @@ -84,8 +84,6 @@ static int min_buffer_length = 60; // minimum buffer length in ms static espeak_ng_STATUS err = ENS_OK; static t_espeak_callback *synth_callback = NULL; -int (*uri_callback)(int, const char *, const char *) = NULL; -int (*phoneme_callback)(const char *) = NULL; char path_home[N_PATH_HOME]; // this is the espeak-ng-data directory extern int saved_parameters[N_SPEECH_PARAM]; // Parameters saved on synthesis start @@ -381,7 +379,8 @@ ESPEAK_NG_API espeak_ng_STATUS espeak_ng_Initialize(espeak_ng_ERROR_CONTEXT *con WavegenInit(srate, 0); LoadConfig(); - memset(¤t_voice_selected, 0, sizeof(current_voice_selected)); + espeak_VOICE *current_voice_selected = espeak_GetCurrentVoice(); + memset(current_voice_selected, 0, sizeof(espeak_VOICE)); SetVoiceStack(NULL, ""); SynthesizeInit(); InitNamedata(); @@ -653,16 +652,6 @@ ESPEAK_API void espeak_SetSynthCallback(t_espeak_callback *SynthCallback) #endif } -ESPEAK_API void espeak_SetUriCallback(int (*UriCallback)(int, const char *, const char *)) -{ - uri_callback = UriCallback; -} - -ESPEAK_API void espeak_SetPhonemeCallback(int (*PhonemeCallback)(const char *)) -{ - phoneme_callback = PhonemeCallback; -} - ESPEAK_NG_API espeak_ng_STATUS espeak_ng_Synthesize(const void *text, size_t size, unsigned int position, diff --git a/src/libespeak-ng/ssml.c b/src/libespeak-ng/ssml.c index 8905e539..32c608f9 100644 --- a/src/libespeak-ng/ssml.c +++ b/src/libespeak-ng/ssml.c @@ -87,6 +87,8 @@ static const MNEM_TAB ssmltags[] = { { NULL, 0 } }; +static int (*uri_callback)(int, const char *, const char *) = NULL; + static int attrcmp(const wchar_t *string1, const char *string2) { int ix; @@ -973,6 +975,13 @@ int ProcessSsmlTag(wchar_t *xml_buf, char *outbuf, int *outix, int n_outbuf, con return 0; } +#pragma GCC visibility push(default) +ESPEAK_API void espeak_SetUriCallback(int (*UriCallback)(int, const char *, const char *)) +{ + uri_callback = UriCallback; +} +#pragma GCC visibility pop + static const MNEM_TAB xml_entity_mnemonics[] = { { "gt", '>' }, { "lt", 0xe000 + '<' }, // private usage area, to avoid confusion with XML tag diff --git a/src/libespeak-ng/synth_mbrola.c b/src/libespeak-ng/synth_mbrola.c index fa632110..a234f13f 100644 --- a/src/libespeak-ng/synth_mbrola.c +++ b/src/libespeak-ng/synth_mbrola.c @@ -77,7 +77,7 @@ espeak_ng_STATUS LoadMbrolaTable(const char *mbrola_voice, const char *phtrans, mbr_name_prefix = 0; if (mbrola_voice == NULL) { - samplerate = samplerate_native; + samplerate = samplerate; SetParameter(espeakVOICETYPE, 0, 0); return ENS_OK; } @@ -350,6 +350,7 @@ int MbrolaTranslate(PHONEME_LIST *plist, int n_phonemes, bool resume, FILE *f_mb const char *final_pitch; char *ptr; char mbr_buf[120]; + char phbuf[5]; static int phix; static int embedded_ix; @@ -405,7 +406,7 @@ int MbrolaTranslate(PHONEME_LIST *plist, int n_phonemes, bool resume, FILE *f_mb DoPhonemeMarker(espeakEVENT_PHONEME, (p->sourceix & 0x7ff) + clause_start_char, 0, phoneme_name); } - ptr += sprintf(ptr, "%s\t", WordToString(name)); + ptr += sprintf(ptr, "%s\t", WordToString(phbuf, name)); if (name2 == '_') { // add a pause after this phoneme @@ -438,7 +439,7 @@ int MbrolaTranslate(PHONEME_LIST *plist, int n_phonemes, bool resume, FILE *f_mb ptr += sprintf(ptr, "%d\t%s", len1, pitch); pitch = WritePitch(p->env, p->pitch1, p->pitch2, -len_percent, 0); - ptr += sprintf(ptr, "%s\t%d\t%s", WordToString(name2), len-len1, pitch); + ptr += sprintf(ptr, "%s\t%d\t%s", WordToString(phbuf, name2), len-len1, pitch); } done = true; break; @@ -490,7 +491,7 @@ int MbrolaTranslate(PHONEME_LIST *plist, int n_phonemes, bool resume, FILE *f_mb if (!done) { if (name2 != 0) { len1 = (len * len_percent)/100; - ptr += sprintf(ptr, "%d\n%s\t", len1, WordToString(name2)); + ptr += sprintf(ptr, "%d\n%s\t", len1, WordToString(phbuf, name2)); len -= len1; } ptr += sprintf(ptr, "%d%s\n", len, final_pitch); diff --git a/src/libespeak-ng/synthdata.c b/src/libespeak-ng/synthdata.c index 8d40149b..c4d4a188 100644 --- a/src/libespeak-ng/synthdata.c +++ b/src/libespeak-ng/synthdata.c @@ -49,7 +49,7 @@ const int version_phdata = 0x014801; // copy the current phoneme table into here int n_phoneme_tab; -int current_phoneme_table; +static int current_phoneme_table; PHONEME_TAB *phoneme_tab[N_PHONEME_TAB]; static unsigned short *phoneme_index = NULL; @@ -164,6 +164,7 @@ void FreePhData(void) phoneme_index = NULL; phondata_ptr = NULL; tunes = NULL; + current_phoneme_table = -1; } int PhonemeCode(unsigned int mnem) @@ -353,6 +354,7 @@ static void SetUpPhonemeTable(int number) void SelectPhonemeTable(int number) { + if (current_phoneme_table == number) return; n_phoneme_tab = 0; MAKE_MEM_UNDEFINED(&phoneme_tab, sizeof(phoneme_tab)); SetUpPhonemeTable(number); // recursively for included phoneme tables @@ -391,7 +393,8 @@ int SelectPhonemeTableName(const char *name) static void InvalidInstn(PHONEME_TAB *ph, int instn) { - fprintf(stderr, "Invalid instruction %.4x for phoneme '%s'\n", instn, WordToString(ph->mnemonic)); + char buf[5]; + fprintf(stderr, "Invalid instruction %.4x for phoneme '%s'\n", instn, WordToString(buf, ph->mnemonic)); } static bool StressCondition(Translator *tr, PHONEME_LIST *plist, int condition, int control) diff --git a/src/libespeak-ng/synthesize.c b/src/libespeak-ng/synthesize.c index f088fc92..217a05a0 100644 --- a/src/libespeak-ng/synthesize.c +++ b/src/libespeak-ng/synthesize.c @@ -68,17 +68,16 @@ static int syllable_centre; static voice_t *new_voice = NULL; +static int (*phoneme_callback)(const char *) = NULL; + #define RMS_GLOTTAL1 35 // vowel before glottal stop #define RMS_START 28 // 28 #define VOWEL_FRONT_LENGTH 50 -const char *WordToString(unsigned int word) +const char *WordToString(char buf[5], unsigned int word) { // Convert a phoneme mnemonic word into a string int ix; - static char buf[5]; - - MAKE_MEM_UNDEFINED(&buf, sizeof(buf)); for (ix = 0; ix < 4; ix++) buf[ix] = word >> (ix*8); @@ -1552,8 +1551,7 @@ int SpeakNextClause(int control) return 0; } - if (current_phoneme_table != voice->phoneme_tab_ix) - SelectPhonemeTable(voice->phoneme_tab_ix); + SelectPhonemeTable(voice->phoneme_tab_ix); // read the next clause from the input text file, translate it, and generate // entries in the wavegen command queue @@ -1592,3 +1590,10 @@ int SpeakNextClause(int control) return 1; } + +#pragma GCC visibility push(default) +ESPEAK_API void espeak_SetPhonemeCallback(int (*PhonemeCallback)(const char *)) +{ + phoneme_callback = PhonemeCallback; +} +#pragma GCC visibility pop diff --git a/src/libespeak-ng/synthesize.h b/src/libespeak-ng/synthesize.h index 4d9db340..6ab34422 100644 --- a/src/libespeak-ng/synthesize.h +++ b/src/libespeak-ng/synthesize.h @@ -76,7 +76,7 @@ extern "C" #define N_EMBEDDED_VALUES 15 extern int embedded_value[N_EMBEDDED_VALUES]; -extern int embedded_default[N_EMBEDDED_VALUES]; +extern const int embedded_default[N_EMBEDDED_VALUES]; #define N_KLATTP 10 // this affects the phoneme data file format #define N_KLATTP2 14 // used in vowel files, with extra parameters for future extensions @@ -423,7 +423,6 @@ void MarkerEvent(int type, unsigned int char_position, int value, int value2, un extern unsigned char *wavefile_data; extern int samplerate; -extern int samplerate_native; #define N_ECHO_BUF 5500 // max of 250mS at 22050 Hz extern int echo_head; @@ -464,7 +463,7 @@ void DoPhonemeMarker(int type, int char_posn, int length, char *name); int DoSample3(PHONEME_DATA *phdata, int length_mod, int amp); int DoSpect2(PHONEME_TAB *this_ph, int which, FMT_PARAMS *fmt_params, PHONEME_LIST *plist, int modulation); int PauseLength(int pause, int control); -const char *WordToString(unsigned int word); +const char *WordToString(char buf[5], unsigned int word); #ifdef __cplusplus } diff --git a/src/libespeak-ng/tr_languages.c b/src/libespeak-ng/tr_languages.c index 6b5f0a9c..c221291d 100644 --- a/src/libespeak-ng/tr_languages.c +++ b/src/libespeak-ng/tr_languages.c @@ -542,7 +542,7 @@ Translator *SelectTranslator(const char *name) { static const unsigned char stress_amps_be[8] = { 12, 10, 8, 8, 0, 0, 16, 17 }; static const short stress_lengths_be[8] = { 160, 140, 200, 140, 0, 0, 240, 160 }; - static wchar_t vowels_be[] = { // offset by 0x420 -- а е ё о у ы э ю я і + static const wchar_t vowels_be[] = { // offset by 0x420 -- а е ё о у ы э ю я і 0x10, 0x15, 0x31, 0x1e, 0x23, 0x2b, 0x2d, 0x2e, 0x2f, 0x36, 0 }; static const unsigned char consonants_be[] = { // б в г д ж з й к л м н п р с т ф х ц ч ш ў diff --git a/src/libespeak-ng/translate.h b/src/libespeak-ng/translate.h index fc58e768..99f697bd 100644 --- a/src/libespeak-ng/translate.h +++ b/src/libespeak-ng/translate.h @@ -649,9 +649,6 @@ extern char dictionary_name[40]; extern espeak_ng_TEXT_DECODER *p_decoder; extern int dictionary_skipwords; -extern int (*uri_callback)(int, const char *, const char *); -extern int (*phoneme_callback)(const char *); - #define LEADING_2_BITS 0xC0 // 0b11000000 #define UTF8_TAIL_BITS 0x80 // 0b10000000 diff --git a/src/libespeak-ng/translateword.c b/src/libespeak-ng/translateword.c index 303c2183..9382bca4 100644 --- a/src/libespeak-ng/translateword.c +++ b/src/libespeak-ng/translateword.c @@ -918,7 +918,8 @@ static int TranslateLetter(Translator *tr, char *word, char *phonemes, int contr char hangul_buf[12]; // speak in the language for this alphabet (or English) - ph_buf[2] = SetTranslator3(WordToString2(language)); + char word_buf[5]; + ph_buf[2] = SetTranslator3(WordToString2(word_buf, language)); if (translator3 != NULL) { int code; diff --git a/src/libespeak-ng/voice.h b/src/libespeak-ng/voice.h index f05c0695..ab079cd5 100644 --- a/src/libespeak-ng/voice.h +++ b/src/libespeak-ng/voice.h @@ -79,8 +79,6 @@ typedef struct { } voice_t; -extern espeak_VOICE current_voice_selected; - extern voice_t *voice; extern int tone_points[12]; diff --git a/src/libespeak-ng/voices.c b/src/libespeak-ng/voices.c index 150694db..b6cf88bb 100644 --- a/src/libespeak-ng/voices.c +++ b/src/libespeak-ng/voices.c @@ -72,7 +72,7 @@ int formant_rate[9]; // values adjusted for actual sample rate static int n_voices_list = 0; static espeak_VOICE *voices_list[N_VOICES_LIST]; -espeak_VOICE current_voice_selected; +static espeak_VOICE current_voice_selected; #define N_VOICE_VARIANTS 12 static const char variants_either[N_VOICE_VARIANTS] = { 1, 2, 12, 3, 13, 4, 14, 5, 11, 0 }; @@ -271,7 +271,7 @@ void VoiceReset(int tone_only) voice->voicing = 64; voice->consonant_amp = 90; // change from 100 to 90 for v.1.47 voice->consonant_ampv = 100; - voice->samplerate = samplerate_native; + voice->samplerate = samplerate; memset(voice->klattv, 0, sizeof(voice->klattv)); speed.fast_settings = espeakRATE_MAXIMUM; @@ -1072,9 +1072,7 @@ char const *SelectVoice(espeak_VOICE *voice_select, int *found) if ((voice_select2.languages == NULL) || (voice_select2.languages[0] == 0)) { // no language is specified. Get language from the named voice - static char buf[60]; - - MAKE_MEM_UNDEFINED(&buf, sizeof(buf)); + char buf[60]; if (voice_select2.name == NULL) { if ((voice_select2.name = voice_select2.identifier) == NULL) diff --git a/src/libespeak-ng/wavegen.c b/src/libespeak-ng/wavegen.c index 407a4acf..fd1b46d3 100644 --- a/src/libespeak-ng/wavegen.c +++ b/src/libespeak-ng/wavegen.c @@ -62,7 +62,6 @@ int embedded_value[N_EMBEDDED_VALUES]; static int PHASE_INC_FACTOR; int samplerate = 0; // this is set by Wavegeninit() -int samplerate_native = 0; static wavegen_peaks_t peaks[N_PEAKS]; static int peak_harmonic[N_PEAKS]; @@ -119,7 +118,7 @@ int wcmdq_head = 0; int wcmdq_tail = 0; // pitch,speed, -int embedded_default[N_EMBEDDED_VALUES] = { 0, 50, espeakRATE_NORMAL, 100, 50, 0, 0, 0, espeakRATE_NORMAL, 0, 0, 0, 0, 0, 0 }; +const int embedded_default[N_EMBEDDED_VALUES] = { 0, 50, espeakRATE_NORMAL, 100, 50, 0, 0, 0, espeakRATE_NORMAL, 0, 0, 0, 0, 0, 0 }; static int embedded_max[N_EMBEDDED_VALUES] = { 0, 0x7fff, 750, 300, 99, 99, 99, 0, 750, 0, 0, 0, 0, 4, 0 }; #if HAVE_SONIC_H @@ -330,7 +329,7 @@ void WavegenInit(int rate, int wavemult_fact) wavemult_fact = 60; // default wvoice = NULL; - samplerate = samplerate_native = rate; + samplerate = rate; PHASE_INC_FACTOR = 0x8000000 / samplerate; // assumes pitch is Hz*32 Flutter_inc = (64 * samplerate)/rate; samplecount = 0;