{ | { | ||||
#endif | #endif | ||||
typedef enum | |||||
{ | |||||
ESPEAKNG_ENCODING_UNKNOWN, | |||||
ESPEAKNG_ENCODING_US_ASCII, | |||||
ESPEAKNG_ENCODING_ISO_8859_1, | |||||
ESPEAKNG_ENCODING_ISO_8859_2, | |||||
ESPEAKNG_ENCODING_ISO_8859_3, | |||||
ESPEAKNG_ENCODING_ISO_8859_4, | |||||
ESPEAKNG_ENCODING_ISO_8859_5, | |||||
ESPEAKNG_ENCODING_ISO_8859_6, | |||||
ESPEAKNG_ENCODING_ISO_8859_7, | |||||
ESPEAKNG_ENCODING_ISO_8859_8, | |||||
ESPEAKNG_ENCODING_ISO_8859_9, | |||||
ESPEAKNG_ENCODING_ISO_8859_10, | |||||
ESPEAKNG_ENCODING_ISO_8859_11, | |||||
// ISO-8859-12 is not a valid encoding. | |||||
ESPEAKNG_ENCODING_ISO_8859_13, | |||||
ESPEAKNG_ENCODING_ISO_8859_14, | |||||
ESPEAKNG_ENCODING_ISO_8859_15, | |||||
ESPEAKNG_ENCODING_ISO_8859_16, | |||||
ESPEAKNG_ENCODING_KOI8_R, | |||||
ESPEAKNG_ENCODING_ISCII, | |||||
ESPEAKNG_ENCODING_UTF_8, | |||||
ESPEAKNG_ENCODING_ISO_10646_UCS_2, | |||||
} espeak_ng_ENCODING; | |||||
ESPEAK_NG_API espeak_ng_ENCODING | |||||
espeak_ng_EncodingFromName(const char *encoding); | |||||
typedef struct espeak_ng_TEXT_DECODER_ espeak_ng_TEXT_DECODER; | typedef struct espeak_ng_TEXT_DECODER_ espeak_ng_TEXT_DECODER; | ||||
espeak_ng_TEXT_DECODER * | |||||
ESPEAK_NG_API espeak_ng_TEXT_DECODER * | |||||
create_text_decoder(void); | create_text_decoder(void); | ||||
void | |||||
ESPEAK_NG_API void | |||||
destroy_text_decoder(espeak_ng_TEXT_DECODER *decoder); | destroy_text_decoder(espeak_ng_TEXT_DECODER *decoder); | ||||
espeak_ng_STATUS | |||||
ESPEAK_NG_API espeak_ng_STATUS | |||||
text_decoder_decode_string(espeak_ng_TEXT_DECODER *decoder, | text_decoder_decode_string(espeak_ng_TEXT_DECODER *decoder, | ||||
const char *string, | const char *string, | ||||
int length, | int length, | ||||
espeak_ng_ENCODING encoding); | espeak_ng_ENCODING encoding); | ||||
espeak_ng_STATUS | |||||
ESPEAK_NG_API espeak_ng_STATUS | |||||
text_decoder_decode_string_auto(espeak_ng_TEXT_DECODER *decoder, | text_decoder_decode_string_auto(espeak_ng_TEXT_DECODER *decoder, | ||||
const char *string, | const char *string, | ||||
int length, | int length, | ||||
espeak_ng_ENCODING encoding); | espeak_ng_ENCODING encoding); | ||||
espeak_ng_STATUS | |||||
ESPEAK_NG_API espeak_ng_STATUS | |||||
text_decoder_decode_wstring(espeak_ng_TEXT_DECODER *decoder, | text_decoder_decode_wstring(espeak_ng_TEXT_DECODER *decoder, | ||||
const wchar_t *string, | const wchar_t *string, | ||||
int length); | int length); | ||||
espeak_ng_STATUS | |||||
ESPEAK_NG_API espeak_ng_STATUS | |||||
text_decoder_decode_string_multibyte(espeak_ng_TEXT_DECODER *decoder, | text_decoder_decode_string_multibyte(espeak_ng_TEXT_DECODER *decoder, | ||||
const void *input, | const void *input, | ||||
espeak_ng_ENCODING encoding, | espeak_ng_ENCODING encoding, | ||||
int flags); | int flags); | ||||
int | |||||
ESPEAK_NG_API int | |||||
text_decoder_eof(espeak_ng_TEXT_DECODER *decoder); | text_decoder_eof(espeak_ng_TEXT_DECODER *decoder); | ||||
uint32_t | |||||
ESPEAK_NG_API uint32_t | |||||
text_decoder_getc(espeak_ng_TEXT_DECODER *decoder); | text_decoder_getc(espeak_ng_TEXT_DECODER *decoder); | ||||
uint32_t | |||||
ESPEAK_NG_API uint32_t | |||||
text_decoder_peekc(espeak_ng_TEXT_DECODER *decoder); | text_decoder_peekc(espeak_ng_TEXT_DECODER *decoder); | ||||
const void * | |||||
ESPEAK_NG_API const void * | |||||
text_decoder_get_buffer(espeak_ng_TEXT_DECODER *decoder); | text_decoder_get_buffer(espeak_ng_TEXT_DECODER *decoder); | ||||
#ifdef __cplusplus | #ifdef __cplusplus |
FILE *log, | FILE *log, | ||||
espeak_ng_ERROR_CONTEXT *context); | espeak_ng_ERROR_CONTEXT *context); | ||||
/* eSpeak NG 1.49.2 */ | |||||
typedef enum | |||||
{ | |||||
ESPEAKNG_ENCODING_UNKNOWN, | |||||
ESPEAKNG_ENCODING_US_ASCII, | |||||
ESPEAKNG_ENCODING_ISO_8859_1, | |||||
ESPEAKNG_ENCODING_ISO_8859_2, | |||||
ESPEAKNG_ENCODING_ISO_8859_3, | |||||
ESPEAKNG_ENCODING_ISO_8859_4, | |||||
ESPEAKNG_ENCODING_ISO_8859_5, | |||||
ESPEAKNG_ENCODING_ISO_8859_6, | |||||
ESPEAKNG_ENCODING_ISO_8859_7, | |||||
ESPEAKNG_ENCODING_ISO_8859_8, | |||||
ESPEAKNG_ENCODING_ISO_8859_9, | |||||
ESPEAKNG_ENCODING_ISO_8859_10, | |||||
ESPEAKNG_ENCODING_ISO_8859_11, | |||||
// ISO-8859-12 is not a valid encoding. | |||||
ESPEAKNG_ENCODING_ISO_8859_13, | |||||
ESPEAKNG_ENCODING_ISO_8859_14, | |||||
ESPEAKNG_ENCODING_ISO_8859_15, | |||||
ESPEAKNG_ENCODING_ISO_8859_16, | |||||
ESPEAKNG_ENCODING_KOI8_R, | |||||
ESPEAKNG_ENCODING_ISCII, | |||||
ESPEAKNG_ENCODING_UTF_8, | |||||
ESPEAKNG_ENCODING_ISO_10646_UCS_2, | |||||
} espeak_ng_ENCODING; | |||||
ESPEAK_NG_API espeak_ng_ENCODING | |||||
espeak_ng_EncodingFromName(const char *encoding); | |||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
} | } | ||||
#endif | #endif |
#include <espeak-ng/espeak_ng.h> | #include <espeak-ng/espeak_ng.h> | ||||
#include <espeak-ng/speak_lib.h> | #include <espeak-ng/speak_lib.h> | ||||
#include <espeak-ng/encoding.h> | |||||
#include "encoding.h" | |||||
#include "error.h" | #include "error.h" | ||||
#include "speech.h" | #include "speech.h" | ||||
#include "phoneme.h" | #include "phoneme.h" |
#include <espeak-ng/espeak_ng.h> | #include <espeak-ng/espeak_ng.h> | ||||
#include <espeak-ng/speak_lib.h> | #include <espeak-ng/speak_lib.h> | ||||
#include <espeak-ng/encoding.h> | |||||
#include "encoding.h" | |||||
#include "speech.h" | #include "speech.h" | ||||
#include "phoneme.h" | #include "phoneme.h" | ||||
#include "synthesize.h" | #include "synthesize.h" |
#include <wchar.h> | #include <wchar.h> | ||||
#include <espeak-ng/espeak_ng.h> | #include <espeak-ng/espeak_ng.h> | ||||
#include <espeak-ng/encoding.h> | |||||
#include "speech.h" | #include "speech.h" | ||||
#include "encoding.h" | |||||
#define LEADING_2_BITS 0xC0 // 0b11000000 | #define LEADING_2_BITS 0xC0 // 0b11000000 | ||||
#define UTF8_TAIL_BITS 0x80 // 0b10000000 | #define UTF8_TAIL_BITS 0x80 // 0b10000000 | ||||
{ string_decoder_getc_iso_10646_ucs_2, NULL }, | { string_decoder_getc_iso_10646_ucs_2, NULL }, | ||||
}; | }; | ||||
#pragma GCC visibility push(default) | |||||
espeak_ng_TEXT_DECODER * | espeak_ng_TEXT_DECODER * | ||||
create_text_decoder(void) | create_text_decoder(void) | ||||
{ | { | ||||
return NULL; | return NULL; | ||||
return decoder->current; | return decoder->current; | ||||
} | } | ||||
#pragma GCC visibility pop |
#include <espeak-ng/espeak_ng.h> | #include <espeak-ng/espeak_ng.h> | ||||
#include <espeak-ng/speak_lib.h> | #include <espeak-ng/speak_lib.h> | ||||
#include <espeak-ng/encoding.h> | |||||
#include "encoding.h" | |||||
#include "speech.h" | #include "speech.h" | ||||
#include "phoneme.h" | #include "phoneme.h" | ||||
#include "synthesize.h" | #include "synthesize.h" |
#include <espeak-ng/espeak_ng.h> | #include <espeak-ng/espeak_ng.h> | ||||
#include <espeak-ng/speak_lib.h> | #include <espeak-ng/speak_lib.h> | ||||
#include <espeak-ng/encoding.h> | |||||
#include "encoding.h" | |||||
#include "speech.h" | #include "speech.h" | ||||
#include "phoneme.h" | #include "phoneme.h" | ||||
#include "synthesize.h" | #include "synthesize.h" |
#include <espeak-ng/espeak_ng.h> | #include <espeak-ng/espeak_ng.h> | ||||
#include <espeak-ng/speak_lib.h> | #include <espeak-ng/speak_lib.h> | ||||
#include <espeak-ng/encoding.h> | |||||
#include "encoding.h" | |||||
#include "speech.h" | #include "speech.h" | ||||
#include "phoneme.h" | #include "phoneme.h" | ||||
#include "synthesize.h" | #include "synthesize.h" |
#include <espeak-ng/espeak_ng.h> | #include <espeak-ng/espeak_ng.h> | ||||
#include <espeak-ng/speak_lib.h> | #include <espeak-ng/speak_lib.h> | ||||
#include <espeak-ng/encoding.h> | |||||
#include "encoding.h" | |||||
#include "speech.h" | #include "speech.h" | ||||
#include "phoneme.h" | #include "phoneme.h" | ||||
#include "synthesize.h" | #include "synthesize.h" |
#include <espeak-ng/espeak_ng.h> | #include <espeak-ng/espeak_ng.h> | ||||
#include <espeak-ng/speak_lib.h> | #include <espeak-ng/speak_lib.h> | ||||
#include <espeak-ng/encoding.h> | |||||
#include "error.h" | #include "error.h" | ||||
#include "encoding.h" | |||||
#include "speech.h" | #include "speech.h" | ||||
#include "phoneme.h" | #include "phoneme.h" | ||||
#include "synthesize.h" | #include "synthesize.h" |
#include <espeak-ng/espeak_ng.h> | #include <espeak-ng/espeak_ng.h> | ||||
#include <espeak-ng/speak_lib.h> | #include <espeak-ng/speak_lib.h> | ||||
#include <espeak-ng/encoding.h> | |||||
#include "encoding.h" | |||||
#include "speech.h" | #include "speech.h" | ||||
#include "phoneme.h" | #include "phoneme.h" | ||||
#include "synthesize.h" | #include "synthesize.h" |
#include <espeak-ng/espeak_ng.h> | #include <espeak-ng/espeak_ng.h> | ||||
#include <espeak-ng/speak_lib.h> | #include <espeak-ng/speak_lib.h> | ||||
#include <espeak-ng/encoding.h> | |||||
#include "encoding.h" | |||||
#include "speech.h" | #include "speech.h" | ||||
#include "phoneme.h" | #include "phoneme.h" | ||||
#include "synthesize.h" | #include "synthesize.h" |
#include <espeak-ng/espeak_ng.h> | #include <espeak-ng/espeak_ng.h> | ||||
#include <espeak-ng/speak_lib.h> | #include <espeak-ng/speak_lib.h> | ||||
#include <espeak-ng/encoding.h> | |||||
#include "encoding.h" | |||||
#include "speech.h" | #include "speech.h" | ||||
#include "phoneme.h" | #include "phoneme.h" | ||||
#include "synthesize.h" | #include "synthesize.h" |
#include <espeak-ng/espeak_ng.h> | #include <espeak-ng/espeak_ng.h> | ||||
#include <espeak-ng/speak_lib.h> | #include <espeak-ng/speak_lib.h> | ||||
#include <espeak-ng/encoding.h> | |||||
#include "encoding.h" | |||||
#include "error.h" | #include "error.h" | ||||
#include "speech.h" | #include "speech.h" | ||||
#include "phoneme.h" | #include "phoneme.h" |
#include <espeak-ng/espeak_ng.h> | #include <espeak-ng/espeak_ng.h> | ||||
#include <espeak-ng/speak_lib.h> | #include <espeak-ng/speak_lib.h> | ||||
#include <espeak-ng/encoding.h> | |||||
#include "encoding.h" | |||||
#include "speech.h" | #include "speech.h" | ||||
#include "phoneme.h" | #include "phoneme.h" | ||||
#include "synthesize.h" | #include "synthesize.h" |
#include <string.h> | #include <string.h> | ||||
#include <espeak-ng/espeak_ng.h> | #include <espeak-ng/espeak_ng.h> | ||||
#include <espeak-ng/encoding.h> | |||||
#include <ucd/ucd.h> | #include <ucd/ucd.h> | ||||
#include "encoding.h" | |||||
#include "tokenizer.h" | #include "tokenizer.h" | ||||
#include "speech.h" | #include "speech.h" | ||||
#include "phoneme.h" | #include "phoneme.h" |
#include <espeak-ng/espeak_ng.h> | #include <espeak-ng/espeak_ng.h> | ||||
#include <espeak-ng/speak_lib.h> | #include <espeak-ng/speak_lib.h> | ||||
#include <espeak-ng/encoding.h> | |||||
#include "encoding.h" | |||||
#include "speech.h" | #include "speech.h" | ||||
#include "phoneme.h" | #include "phoneme.h" | ||||
#include "synthesize.h" | #include "synthesize.h" |
#include <espeak-ng/espeak_ng.h> | #include <espeak-ng/espeak_ng.h> | ||||
#include <espeak-ng/speak_lib.h> | #include <espeak-ng/speak_lib.h> | ||||
#include <espeak-ng/encoding.h> | |||||
#include "encoding.h" | |||||
#include "speech.h" | #include "speech.h" | ||||
#include "phoneme.h" | #include "phoneme.h" | ||||
#include "synthesize.h" | #include "synthesize.h" |
#include <espeak-ng/espeak_ng.h> | #include <espeak-ng/espeak_ng.h> | ||||
#include <espeak-ng/speak_lib.h> | #include <espeak-ng/speak_lib.h> | ||||
#include <espeak-ng/encoding.h> | |||||
#include "encoding.h" | |||||
#include "speech.h" | #include "speech.h" | ||||
#include "phoneme.h" | #include "phoneme.h" | ||||
#include "synthesize.h" | #include "synthesize.h" |
#include <stdio.h> | #include <stdio.h> | ||||
#include <espeak-ng/espeak_ng.h> | #include <espeak-ng/espeak_ng.h> | ||||
#include "encoding.h" | |||||
#include <espeak-ng/encoding.h> | |||||
void | void | ||||
test_unbound_text_decoder() | test_unbound_text_decoder() |
#include <sys/stat.h> | #include <sys/stat.h> | ||||
#include <espeak-ng/espeak_ng.h> | #include <espeak-ng/espeak_ng.h> | ||||
#include <espeak-ng/encoding.h> | |||||
#include "encoding.h" | |||||
#include "tokenizer.h" | #include "tokenizer.h" | ||||
#include "speech.h" | #include "speech.h" | ||||
#include "phoneme.h" | #include "phoneme.h" |