Browse Source

Create an espeak-ng version of espeak_SetPunctuationList.

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

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

@@ -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,

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

@@ -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);

+ 6
- 19
src/libespeak-ng/speech.c View File

@@ -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
}


Loading…
Cancel
Save