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

int value, int value,
int relative); int relative);


ESPEAK_NG_API espeak_ng_STATUS
espeak_ng_SetPunctuationList(const wchar_t *punctlist);

ESPEAK_NG_API espeak_ng_STATUS ESPEAK_NG_API espeak_ng_STATUS
espeak_ng_Synthesize(const void *text, espeak_ng_Synthesize(const void *text,
size_t size, size_t size,

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

return status_to_espeak_error(espeak_ng_SetParameter(parameter, value, relative)); 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_API void espeak_CompileDictionary(const char *path, FILE *log, int flags)
{ {
espeak_ng_CompileDictionary(path, dictionary_name, log, flags); espeak_ng_CompileDictionary(path, dictionary_name, log, flags);

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

voice_samplerate = wvoice->samplerate; 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 #ifdef USE_ASYNC


static int dispatch_audio(short *outbuf, int length, espeak_EVENT *event) static int dispatch_audio(short *outbuf, int length, espeak_EVENT *event)
#endif #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". // Set the list of punctuation which are spoken for "some".


#ifdef USE_ASYNC #ifdef USE_ASYNC
espeak_ERROR a_error;

if (my_mode & ENOUTPUT_MODE_SYNCHRONOUS) { if (my_mode & ENOUTPUT_MODE_SYNCHRONOUS) {
sync_espeak_SetPunctuationList(punctlist); sync_espeak_SetPunctuationList(punctlist);
return EE_OK;
return ENS_OK;
} }


t_espeak_command *c = create_espeak_punctuation_list(punctlist); 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); delete_espeak_command(c);
return a_error;
return status;
#else #else
sync_espeak_SetPunctuationList(punctlist); sync_espeak_SetPunctuationList(punctlist);
return EE_OK;
return ENS_OK;
#endif #endif
} }



Loading…
Cancel
Save