diff --git a/src/include/espeak-ng/espeak_ng.h b/src/include/espeak-ng/espeak_ng.h index 38c9a95b..85ccdc1e 100644 --- a/src/include/espeak-ng/espeak_ng.h +++ b/src/include/espeak-ng/espeak_ng.h @@ -69,6 +69,9 @@ espeak_ng_SetParameter(espeak_PARAMETER parameter, int value, int relative); +ESPEAK_NG_API espeak_ng_STATUS +espeak_ng_SetPunctuationList(const wchar_t *punctlist); + ESPEAK_NG_API espeak_ng_STATUS espeak_ng_Synthesize(const void *text, size_t size, diff --git a/src/libespeak-ng/espeak_api.c b/src/libespeak-ng/espeak_api.c index 0114e69b..1f643a34 100644 --- a/src/libespeak-ng/espeak_api.c +++ b/src/libespeak-ng/espeak_api.c @@ -136,6 +136,11 @@ ESPEAK_API espeak_ERROR espeak_SetParameter(espeak_PARAMETER parameter, int valu return status_to_espeak_error(espeak_ng_SetParameter(parameter, value, relative)); } +ESPEAK_API espeak_ERROR espeak_SetPunctuationList(const wchar_t *punctlist) +{ + return status_to_espeak_error(espeak_ng_SetPunctuationList(punctlist)); +} + ESPEAK_API void espeak_CompileDictionary(const char *path, FILE *log, int flags) { espeak_ng_CompileDictionary(path, dictionary_name, log, flags); diff --git a/src/libespeak-ng/speech.c b/src/libespeak-ng/speech.c index bf931bcc..8648bd49 100644 --- a/src/libespeak-ng/speech.c +++ b/src/libespeak-ng/speech.c @@ -86,17 +86,6 @@ void WVoiceChanged(voice_t *wvoice) voice_samplerate = wvoice->samplerate; } -static espeak_ERROR status_to_espeak_error(espeak_ng_STATUS status) -{ - switch (status) - { - case ENS_OK: return EE_OK; - case ENOENT: return EE_NOT_FOUND; - case ENS_FIFO_BUFFER_FULL: return EE_BUFFER_FULL; - default: return EE_INTERNAL_ERROR; - } -} - #ifdef USE_ASYNC static int dispatch_audio(short *outbuf, int length, espeak_EVENT *event) @@ -764,26 +753,24 @@ ESPEAK_NG_API espeak_ng_STATUS espeak_ng_SetParameter(espeak_PARAMETER parameter #endif } -ESPEAK_API espeak_ERROR espeak_SetPunctuationList(const wchar_t *punctlist) +ESPEAK_NG_API espeak_ng_STATUS espeak_ng_SetPunctuationList(const wchar_t *punctlist) { // Set the list of punctuation which are spoken for "some". #ifdef USE_ASYNC - espeak_ERROR a_error; - if (my_mode & ENOUTPUT_MODE_SYNCHRONOUS) { sync_espeak_SetPunctuationList(punctlist); - return EE_OK; + return ENS_OK; } t_espeak_command *c = create_espeak_punctuation_list(punctlist); - a_error = status_to_espeak_error(fifo_add_command(c)); - if (a_error != EE_OK) + espeak_ng_STATUS status = fifo_add_command(c); + if (status != ENS_OK) delete_espeak_command(c); - return a_error; + return status; #else sync_espeak_SetPunctuationList(punctlist); - return EE_OK; + return ENS_OK; #endif }