123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613 |
- #ifndef SPEAK_LIB_H
- #define SPEAK_LIB_H
-
-
-
-
-
-
-
-
- #include <stdio.h>
- #include <stddef.h>
-
- #define ESPEAK_API_REVISION 6
-
-
-
-
-
-
- #define espeakRATE_MINIMUM 80
- #define espeakRATE_MAXIMUM 450
- #define espeakRATE_NORMAL 175
-
-
- typedef enum {
- espeakEVENT_LIST_TERMINATED = 0,
- espeakEVENT_WORD = 1,
- espeakEVENT_SENTENCE = 2,
- espeakEVENT_MARK = 3,
- espeakEVENT_PLAY = 4,
- espeakEVENT_END = 5,
- espeakEVENT_MSG_TERMINATED = 6,
- espeakEVENT_PHONEME = 7,
- espeakEVENT_SAMPLERATE = 8
- } espeak_EVENT_TYPE;
-
-
-
- typedef struct {
- espeak_EVENT_TYPE type;
- unsigned int unique_identifier;
- int text_position;
- int length;
- int audio_position;
- int sample;
- void* user_data;
- union {
- int number;
- const char *name;
- } id;
- } espeak_EVENT;
-
-
-
-
- typedef enum {
- POS_CHARACTER = 1,
- POS_WORD,
- POS_SENTENCE
- } espeak_POSITION_TYPE;
-
-
- typedef enum {
-
- AUDIO_OUTPUT_PLAYBACK,
-
-
- AUDIO_OUTPUT_RETRIEVAL,
-
-
- AUDIO_OUTPUT_SYNCHRONOUS,
-
-
- AUDIO_OUTPUT_SYNCH_PLAYBACK
-
- } espeak_AUDIO_OUTPUT;
-
-
- typedef enum {
- EE_OK=0,
- EE_INTERNAL_ERROR=-1,
- EE_BUFFER_FULL=1,
- EE_NOT_FOUND=2
- } espeak_ERROR;
-
-
- #ifdef __cplusplus
- extern "C"
- #endif
- int espeak_Initialize(espeak_AUDIO_OUTPUT output, int buflength, const char *path, int options);
-
-
- typedef int (t_espeak_callback)(short*, int, espeak_EVENT*);
-
- #ifdef __cplusplus
- extern "C"
- #endif
- void espeak_SetSynthCallback(t_espeak_callback* SynthCallback);
-
-
- #ifdef __cplusplus
- extern "C"
- #endif
- void espeak_SetUriCallback(int (*UriCallback)(int, const char*, const char*));
-
-
-
-
-
-
-
-
- #define espeakCHARS_AUTO 0
- #define espeakCHARS_UTF8 1
- #define espeakCHARS_8BIT 2
- #define espeakCHARS_WCHAR 3
- #define espeakCHARS_16BIT 4
-
- #define espeakSSML 0x10
- #define espeakPHONEMES 0x100
- #define espeakENDPAUSE 0x1000
- #define espeakKEEP_NAMEDATA 0x2000
-
- #ifdef __cplusplus
- extern "C"
- #endif
- espeak_ERROR espeak_Synth(const void *text,
- size_t size,
- unsigned int position,
- espeak_POSITION_TYPE position_type,
- unsigned int end_position,
- unsigned int flags,
- unsigned int* unique_identifier,
- void* user_data);
-
-
- #ifdef __cplusplus
- extern "C"
- #endif
- espeak_ERROR espeak_Synth_Mark(const void *text,
- size_t size,
- const char *index_mark,
- unsigned int end_position,
- unsigned int flags,
- unsigned int* unique_identifier,
- void* user_data);
-
-
- #ifdef __cplusplus
- extern "C"
- #endif
- espeak_ERROR espeak_Key(const char *key_name);
-
-
- #ifdef __cplusplus
- extern "C"
- #endif
- espeak_ERROR espeak_Char(wchar_t character);
-
-
-
-
-
-
-
-
-
- typedef enum {
- espeakSILENCE=0,
- espeakRATE=1,
- espeakVOLUME=2,
- espeakPITCH=3,
- espeakRANGE=4,
- espeakPUNCTUATION=5,
- espeakCAPITALS=6,
- espeakWORDGAP=7,
- espeakOPTIONS=8,
- espeakINTONATION=9,
-
- espeakRESERVED1=10,
- espeakRESERVED2=11,
- espeakEMPHASIS,
- espeakLINELENGTH,
- espeakVOICETYPE,
- N_SPEECH_PARAM
- } espeak_PARAMETER;
-
- typedef enum {
- espeakPUNCT_NONE=0,
- espeakPUNCT_ALL=1,
- espeakPUNCT_SOME=2
- } espeak_PUNCT_TYPE;
-
- #ifdef __cplusplus
- extern "C"
- #endif
- espeak_ERROR espeak_SetParameter(espeak_PARAMETER parameter, int value, int relative);
-
-
- #ifdef __cplusplus
- extern "C"
- #endif
- int espeak_GetParameter(espeak_PARAMETER parameter, int current);
-
-
- #ifdef __cplusplus
- extern "C"
- #endif
- espeak_ERROR espeak_SetPunctuationList(const wchar_t *punctlist);
-
-
- #ifdef __cplusplus
- extern "C"
- #endif
- void espeak_SetPhonemeTrace(int value, FILE *stream);
-
-
- #ifdef __cplusplus
- extern "C"
- #endif
- void espeak_CompileDictionary(const char *path, FILE *log, int flags);
-
-
-
-
-
-
-
- typedef struct {
- const char *name;
- const char *languages;
- const char *identifier;
- unsigned char gender;
- unsigned char age;
- unsigned char variant;
- unsigned char xx1;
- int score;
- void *spare;
- } espeak_VOICE;
-
-
-
- #ifdef __cplusplus
- extern "C"
- #endif
- const espeak_VOICE **espeak_ListVoices(espeak_VOICE *voice_spec);
-
-
- #ifdef __cplusplus
- extern "C"
- #endif
- espeak_ERROR espeak_SetVoiceByName(const char *name);
-
-
- #ifdef __cplusplus
- extern "C"
- #endif
- espeak_ERROR espeak_SetVoiceByProperties(espeak_VOICE *voice_spec);
-
-
- #ifdef __cplusplus
- extern "C"
- #endif
- espeak_VOICE *espeak_GetCurrentVoice(void);
-
-
- #ifdef __cplusplus
- extern "C"
- #endif
- espeak_ERROR espeak_Cancel(void);
-
-
-
- #ifdef __cplusplus
- extern "C"
- #endif
- int espeak_IsPlaying(void);
-
-
- #ifdef __cplusplus
- extern "C"
- #endif
- espeak_ERROR espeak_Synchronize(void);
-
-
- #ifdef __cplusplus
- extern "C"
- #endif
- espeak_ERROR espeak_Terminate(void);
-
-
-
- #ifdef __cplusplus
- extern "C"
- #endif
- const char *espeak_Info(void* ptr);
-
- #endif
|