Browse Source

Don't reset the parameters unless they have been set.

This is based on a patch by Samuel Thibault.

This is needed when espeak_Cancel is called before espeak_Synth,
like can be done in brltty.
master
Reece H. Dunn 8 years ago
parent
commit
26e453dd2f
2 changed files with 8 additions and 2 deletions
  1. 1
    0
      CHANGELOG.md
  2. 7
    2
      src/libespeak-ng/speech.c

+ 1
- 0
CHANGELOG.md View File

* Fixes for running the spect code on big-endian architectures. * Fixes for running the spect code on big-endian architectures.
* Fix determining the voice directory when installing the 32-bit Windows * Fix determining the voice directory when installing the 32-bit Windows
binaries on a 64-bit Windows system. binaries on a 64-bit Windows system.
* Don't reset the speech parameters unless they have already been set.


updated languages: updated languages:



+ 7
- 2
src/libespeak-ng/speech.c View File

static int out_samplerate = 0; static int out_samplerate = 0;
static int voice_samplerate = 22050; static int voice_samplerate = 22050;
static espeak_ng_STATUS err = ENS_OK; static espeak_ng_STATUS err = ENS_OK;
static int did_save_parameters = 0;


t_espeak_callback *synth_callback = NULL; t_espeak_callback *synth_callback = NULL;
int (*uri_callback)(int, const char *, const char *) = NULL; int (*uri_callback)(int, const char *, const char *) = NULL;
my_unique_identifier = unique_identifier; my_unique_identifier = unique_identifier;
my_user_data = user_data; my_user_data = user_data;


did_save_parameters = 1;
for (int i = 0; i < N_SPEECH_PARAM; i++) for (int i = 0; i < N_SPEECH_PARAM; i++)
saved_parameters[i] = param_stack[0].parameter[i]; saved_parameters[i] = param_stack[0].parameter[i];


#endif #endif
embedded_value[EMBED_T] = 0; // reset echo for pronunciation announcements embedded_value[EMBED_T] = 0; // reset echo for pronunciation announcements


for (int i = 0; i < N_SPEECH_PARAM; i++)
SetParameter(i, saved_parameters[i], 0);
if (did_save_parameters) {
for (int i = 0; i < N_SPEECH_PARAM; i++)
SetParameter(i, saved_parameters[i], 0);
did_save_parameters = 0;
}


return ENS_OK; return ENS_OK;
} }

Loading…
Cancel
Save