ENS_FIFO_BUFFER_FULL = 0x100003FF, | ENS_FIFO_BUFFER_FULL = 0x100003FF, | ||||
ENS_NOT_INITIALIZED = 0x100004FF, | ENS_NOT_INITIALIZED = 0x100004FF, | ||||
ENS_AUDIO_ERROR = 0x100005FF, | ENS_AUDIO_ERROR = 0x100005FF, | ||||
ENS_VOICE_NOT_FOUND = 0x100006FF, | |||||
} espeak_ng_STATUS; | } espeak_ng_STATUS; | ||||
typedef enum { | typedef enum { | ||||
ESPEAK_NG_API espeak_ng_STATUS | ESPEAK_NG_API espeak_ng_STATUS | ||||
espeak_ng_SetPunctuationList(const wchar_t *punctlist); | espeak_ng_SetPunctuationList(const wchar_t *punctlist); | ||||
ESPEAK_NG_API espeak_ng_STATUS | |||||
espeak_ng_SetVoiceByName(const char *name); | |||||
ESPEAK_NG_API espeak_ng_STATUS | |||||
espeak_ng_SetVoiceByProperties(espeak_VOICE *voice_selector); | |||||
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, |
return status_to_espeak_error(espeak_ng_SetPunctuationList(punctlist)); | return status_to_espeak_error(espeak_ng_SetPunctuationList(punctlist)); | ||||
} | } | ||||
ESPEAK_API espeak_ERROR espeak_SetVoiceByName(const char *name) | |||||
{ | |||||
return status_to_espeak_error(espeak_SetVoiceByName(name)); | |||||
} | |||||
ESPEAK_API espeak_ERROR espeak_SetVoiceByProperties(espeak_VOICE *voice_selector) | |||||
{ | |||||
return status_to_espeak_error(espeak_SetVoiceByProperties(voice_selector)); | |||||
} | |||||
ESPEAK_API espeak_ERROR espeak_Cancel(void) | ESPEAK_API espeak_ERROR espeak_Cancel(void) | ||||
{ | { | ||||
return status_to_espeak_error(espeak_ng_Cancel()); | return status_to_espeak_error(espeak_ng_Cancel()); |
espeak_ng_STATUS sync_espeak_Char(wchar_t character); | espeak_ng_STATUS sync_espeak_Char(wchar_t character); | ||||
void sync_espeak_SetPunctuationList(const wchar_t *punctlist); | void sync_espeak_SetPunctuationList(const wchar_t *punctlist); | ||||
void sync_espeak_SetParameter(espeak_PARAMETER parameter, int value, int relative); | void sync_espeak_SetParameter(espeak_PARAMETER parameter, int value, int relative); | ||||
int sync_espeak_SetVoiceByName(const char *name); | |||||
int sync_espeak_SetVoiceByProperties(espeak_VOICE *voice_selector); | |||||
espeak_ng_STATUS SetParameter(int parameter, int value, int relative); | espeak_ng_STATUS SetParameter(int parameter, int value, int relative); | ||||
int sync_espeak_terminated_msg(unsigned int unique_identifier, void *user_data); | int sync_espeak_terminated_msg(unsigned int unique_identifier, void *user_data); |
#pragma GCC visibility push(default) | #pragma GCC visibility push(default) | ||||
espeak_ERROR espeak_SetVoiceByName(const char *name) | |||||
ESPEAK_NG_API espeak_ng_STATUS espeak_ng_SetVoiceByName(const char *name) | |||||
{ | { | ||||
espeak_VOICE *v; | espeak_VOICE *v; | ||||
int ix; | int ix; | ||||
DoVoiceChange(voice); | DoVoiceChange(voice); | ||||
voice_selector.languages = voice->language_name; | voice_selector.languages = voice->language_name; | ||||
SetVoiceStack(&voice_selector, variant_name); | SetVoiceStack(&voice_selector, variant_name); | ||||
return EE_OK; | |||||
return ENS_OK; | |||||
} | } | ||||
if (n_voices_list == 0) | if (n_voices_list == 0) | ||||
return EE_OK; | return EE_OK; | ||||
} | } | ||||
} | } | ||||
return EE_INTERNAL_ERROR; // voice name not found | |||||
return ENS_VOICE_NOT_FOUND; | |||||
} | } | ||||
espeak_ERROR espeak_SetVoiceByProperties(espeak_VOICE *voice_selector) | |||||
ESPEAK_NG_API espeak_ng_STATUS espeak_ng_SetVoiceByProperties(espeak_VOICE *voice_selector) | |||||
{ | { | ||||
const char *voice_id; | const char *voice_id; | ||||
int voice_found; | int voice_found; | ||||
voice_id = SelectVoice(voice_selector, &voice_found); | voice_id = SelectVoice(voice_selector, &voice_found); | ||||
if (voice_found == 0) | if (voice_found == 0) | ||||
return EE_NOT_FOUND; | |||||
return ENS_VOICE_NOT_FOUND; | |||||
LoadVoiceVariant(voice_id, 0); | LoadVoiceVariant(voice_id, 0); | ||||
DoVoiceChange(voice); | DoVoiceChange(voice); | ||||
SetVoiceStack(voice_selector, ""); | SetVoiceStack(voice_selector, ""); | ||||
return EE_OK; | |||||
return ENS_OK; | |||||
} | } | ||||
#pragma GCC visibility pop | #pragma GCC visibility pop |