Browse Source

Create an espeak-ng version of espeak_Synchronize.

master
Reece H. Dunn 9 years ago
parent
commit
4ba60623e8
3 changed files with 13 additions and 5 deletions
  1. 3
    0
      src/include/espeak-ng/espeak_ng.h
  2. 5
    0
      src/libespeak-ng/espeak_api.c
  3. 5
    5
      src/libespeak-ng/speech.c

+ 3
- 0
src/include/espeak-ng/espeak_ng.h View File

@@ -100,6 +100,9 @@ espeak_ng_SpeakCharacter(wchar_t character);
ESPEAK_NG_API espeak_ng_STATUS
espeak_ng_Cancel(void);

ESPEAK_NG_API espeak_ng_STATUS
espeak_ng_Synchronize(void);

ESPEAK_NG_API espeak_ng_STATUS
espeak_ng_CompileDictionary(const char *dsource,
const char *dict_name,

+ 5
- 0
src/libespeak-ng/espeak_api.c View File

@@ -146,6 +146,11 @@ ESPEAK_API espeak_ERROR espeak_Cancel(void)
return status_to_espeak_error(espeak_ng_Cancel());
}

ESPEAK_API espeak_ERROR espeak_Synchronize(void)
{
return status_to_espeak_error(espeak_ng_Synchronize());
}

ESPEAK_API void espeak_CompileDictionary(const char *path, FILE *log, int flags)
{
espeak_ng_CompileDictionary(path, dictionary_name, log, flags);

+ 5
- 5
src/libespeak-ng/speech.c View File

@@ -71,7 +71,7 @@ static void *my_user_data = NULL;
static espeak_ng_OUTPUT_MODE my_mode = ENOUTPUT_MODE_SYNCHRONOUS;
static int out_samplerate = 0;
static int voice_samplerate = 22050;
static espeak_ERROR err = EE_OK;
static espeak_ng_STATUS err = ENS_OK;

t_espeak_callback *synth_callback = NULL;
int (*uri_callback)(int, const char *, const char *) = NULL;
@@ -112,7 +112,7 @@ static int dispatch_audio(short *outbuf, int length, espeak_EVENT *event)
out_samplerate = voice_samplerate;
my_audio = wave_open(voice_samplerate, option_device);
if (!my_audio) {
err = EE_INTERNAL_ERROR;
err = ENS_AUDIO_ERROR;
return -1;
}
wave_set_callback_is_output_enabled(fifo_is_command_enabled);
@@ -837,14 +837,14 @@ ESPEAK_API int espeak_IsPlaying(void)
#endif
}

ESPEAK_API espeak_ERROR espeak_Synchronize(void)
ESPEAK_NG_API espeak_ng_STATUS espeak_ng_Synchronize(void)
{
espeak_ERROR berr = err;
espeak_ng_STATUS berr = err;
#ifdef USE_ASYNC
while (espeak_IsPlaying())
usleep(20000);
#endif
err = EE_OK;
err = ENS_OK;
return berr;
}


Loading…
Cancel
Save