1 #ifndef SPEAK_LIB_H
2 #define SPEAK_LIB_H
3 /***************************************************************************
4  *   Copyright (C) 2005 to 2012 by Jonathan Duddington                     *
5  *   email: jonsd@users.sourceforge.net                                    *
6  *                                                                         *
7  *   This program is free software; you can redistribute it and/or modify  *
8  *   it under the terms of the GNU General Public License as published by  *
9  *   the Free Software Foundation; either version 3 of the License, or     *
10  *   (at your option) any later version.                                   *
11  *                                                                         *
12  *   This program is distributed in the hope that it will be useful,       *
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
15  *   GNU General Public License for more details.                          *
16  *                                                                         *
17  *   You should have received a copy of the GNU General Public License     *
18  *   along with this program; if not, see:                                 *
19  *               <http://www.gnu.org/licenses/>.                           *
20  ***************************************************************************/
21 
22 
23 /*************************************************************/
24 /* This is the header file for the library version of espeak */
25 /*                                                           */
26 /*************************************************************/
27 
28 #include <stdio.h>
29 #include <stddef.h>
30 
31 #ifdef __WIN32__
32 #define ESPEAK_API __declspec(dllexport)
33 #else
34 #define ESPEAK_API
35 #endif
36 
37 #define ESPEAK_API_REVISION  9
38 /*
39 Revision 2
40    Added parameter "options" to eSpeakInitialize()
41 
42 Revision 3
43    Added espeakWORDGAP to  espeak_PARAMETER
44 
45 Revision 4
46    Added flags parameter to espeak_CompileDictionary()
47 
48 Revision 5
49    Added espeakCHARS_16BIT
50 
51 Revision 6
52   Added macros: espeakRATE_MINIMUM, espeakRATE_MAXIMUM, espeakRATE_NORMAL
53 
54 Revision 7  24.Dec.2011
55   Changed espeak_EVENT structure to add id.string[] for phoneme mnemonics.
56   Added espeakINITIALIZE_PHONEME_IPA option for espeak_Initialize() to report phonemes as IPA names.
57 
58 Revision 8  26.Apr.2013
59   Added function espeak_TextToPhonemes().
60 
61 Revision 9  30.May.2013
62   Changed function espeak_TextToPhonemes().
63 
64 */
65          /********************/
66          /*  Initialization  */
67          /********************/
68 
69 // values for 'value' in espeak_SetParameter(espeakRATE, value, 0), nominally in words-per-minute
70 #define espeakRATE_MINIMUM  80
71 #define espeakRATE_MAXIMUM  450
72 #define espeakRATE_NORMAL   175
73 
74 
75 typedef enum {
76   espeakEVENT_LIST_TERMINATED = 0, // Retrieval mode: terminates the event list.
77   espeakEVENT_WORD = 1,            // Start of word
78   espeakEVENT_SENTENCE = 2,        // Start of sentence
79   espeakEVENT_MARK = 3,            // Mark
80   espeakEVENT_PLAY = 4,            // Audio element
81   espeakEVENT_END = 5,             // End of sentence or clause
82   espeakEVENT_MSG_TERMINATED = 6,  // End of message
83   espeakEVENT_PHONEME = 7,         // Phoneme, if enabled in espeak_Initialize()
84   espeakEVENT_SAMPLERATE = 8       // internal use, set sample rate
85 } espeak_EVENT_TYPE;
86 
87 
88 
89 typedef struct {
90 	espeak_EVENT_TYPE type;
91 	unsigned int unique_identifier; // message identifier (or 0 for key or character)
92 	int text_position;    // the number of characters from the start of the text
93 	int length;           // word length, in characters (for espeakEVENT_WORD)
94 	int audio_position;   // the time in mS within the generated speech output data
95 	int sample;           // sample id (internal use)
96 	void* user_data;      // pointer supplied by the calling program
97 	union {
98 		int number;        // used for WORD and SENTENCE events.
99 		const char *name;  // used for MARK and PLAY events.  UTF8 string
100 		char string[8];    // used for phoneme names (UTF8). Terminated by a zero byte unless the name needs the full 8 bytes.
101 	} id;
102 } espeak_EVENT;
103 /*
104    When a message is supplied to espeak_synth, the request is buffered and espeak_synth returns. When the message is really processed, the callback function will be repetedly called.
105 
106 
107    In RETRIEVAL mode, the callback function supplies to the calling program the audio data and an event list terminated by 0 (LIST_TERMINATED).
108 
109    In PLAYBACK mode, the callback function is called as soon as an event happens.
110 
111    For example suppose that the following message is supplied to espeak_Synth:
112    "hello, hello."
113 
114 
115    * Once processed in RETRIEVAL mode, it could lead to 3 calls of the callback function :
116 
117    ** Block 1:
118    <audio data> +
119    List of events: SENTENCE + WORD + LIST_TERMINATED
120 
121    ** Block 2:
122    <audio data> +
123    List of events: WORD + END + LIST_TERMINATED
124 
125    ** Block 3:
126    no audio data
127    List of events: MSG_TERMINATED + LIST_TERMINATED
128 
129 
130    * Once processed in PLAYBACK mode, it could lead to 5 calls of the callback function:
131 
132    ** SENTENCE
133    ** WORD (call when the sounds are actually played)
134    ** WORD
135    ** END (call when the end of sentence is actually played.)
136    ** MSG_TERMINATED
137 
138 
139    The MSG_TERMINATED event is the last event. It can inform the calling program to clear the user data related to the message.
140    So if the synthesis must be stopped, the callback function is called for each pending message with the MSG_TERMINATED event.
141 
142    A MARK event indicates a <mark> element in the text.
143    A PLAY event indicates an <audio> element in the text, for which the calling program should play the named sound file.
144 */
145 
146 
147 
148 typedef enum {
149 	POS_CHARACTER = 1,
150 	POS_WORD,
151 	POS_SENTENCE
152 } espeak_POSITION_TYPE;
153 
154 
155 typedef enum {
156 	/* PLAYBACK mode: plays the audio data, supplies events to the calling program*/
157 	AUDIO_OUTPUT_PLAYBACK,
158 
159 	/* RETRIEVAL mode: supplies audio data and events to the calling program */
160 	AUDIO_OUTPUT_RETRIEVAL,
161 
162 	/* SYNCHRONOUS mode: as RETRIEVAL but doesn't return until synthesis is completed */
163 	AUDIO_OUTPUT_SYNCHRONOUS,
164 
165 	/* Synchronous playback */
166 	AUDIO_OUTPUT_SYNCH_PLAYBACK
167 
168 } espeak_AUDIO_OUTPUT;
169 
170 
171 typedef enum {
172 	EE_OK=0,
173 	EE_INTERNAL_ERROR=-1,
174 	EE_BUFFER_FULL=1,
175 	EE_NOT_FOUND=2
176 } espeak_ERROR;
177 
178 #define espeakINITIALIZE_PHONEME_EVENTS 0x0001
179 #define espeakINITIALIZE_PHONEME_IPA   0x0002
180 #define espeakINITIALIZE_DONT_EXIT     0x8000
181 
182 #ifdef __cplusplus
183 extern "C"
184 #endif
185 ESPEAK_API int espeak_Initialize(espeak_AUDIO_OUTPUT output, int buflength, const char *path, int options);
186 /* Must be called before any synthesis functions are called.
187    output: the audio data can either be played by eSpeak or passed back by the SynthCallback function.
188 
189    buflength:  The length in mS of sound buffers passed to the SynthCallback function.
190             Value=0 gives a default of 200mS.
191             This paramater is only used for AUDIO_OUTPUT_RETRIEVAL and AUDIO_OUTPUT_SYNCHRONOUS modes.
192 
193    path: The directory which contains the espeak-data directory, or NULL for the default location.
194 
195    options: bit 0:  1=allow espeakEVENT_PHONEME events.
196             bit 1:  1= espeakEVENT_PHONEME events give IPA phoneme names, not eSpeak phoneme names
197             bit 15: 1=don't exit if espeak_data is not found (used for --help)
198 
199    Returns: sample rate in Hz, or -1 (EE_INTERNAL_ERROR).
200 */
201 
202 typedef int (t_espeak_callback)(short*, int, espeak_EVENT*);
203 
204 #ifdef __cplusplus
205 extern "C"
206 #endif
207 ESPEAK_API void espeak_SetSynthCallback(t_espeak_callback* SynthCallback);
208 /* Must be called before any synthesis functions are called.
209    This specifies a function in the calling program which is called when a buffer of
210    speech sound data has been produced.
211 
212 
213    The callback function is of the form:
214 
215 int SynthCallback(short *wav, int numsamples, espeak_EVENT *events);
216 
217    wav:  is the speech sound data which has been produced.
218       NULL indicates that the synthesis has been completed.
219 
220    numsamples: is the number of entries in wav.  This number may vary, may be less than
221       the value implied by the buflength parameter given in espeak_Initialize, and may
222       sometimes be zero (which does NOT indicate end of synthesis).
223 
224    events: an array of espeak_EVENT items which indicate word and sentence events, and
225       also the occurance if <mark> and <audio> elements within the text.  The list of
226       events is terminated by an event of type = 0.
227 
228 
229    Callback returns: 0=continue synthesis,  1=abort synthesis.
230 */
231 
232 #ifdef __cplusplus
233 extern "C"
234 #endif
235 ESPEAK_API void espeak_SetUriCallback(int (*UriCallback)(int, const char*, const char*));
236 /* This function may be called before synthesis functions are used, in order to deal with
237    <audio> tags.  It specifies a callback function which is called when an <audio> element is
238    encountered and allows the calling program to indicate whether the sound file which
239    is specified in the <audio> element is available and is to be played.
240 
241    The callback function is of the form:
242 
243 int UriCallback(int type, const char *uri, const char *base);
244 
245    type:  type of callback event.  Currently only 1= <audio> element
246 
247    uri:   the "src" attribute from the <audio> element
248 
249    base:  the "xml:base" attribute (if any) from the <speak> element
250 
251    Return: 1=don't play the sound, but speak the text alternative.
252            0=place a PLAY event in the event list at the point where the <audio> element
253              occurs.  The calling program can then play the sound at that point.
254 */
255 
256 
257          /********************/
258          /*    Synthesis     */
259          /********************/
260 
261 
262 #define espeakCHARS_AUTO   0
263 #define espeakCHARS_UTF8   1
264 #define espeakCHARS_8BIT   2
265 #define espeakCHARS_WCHAR  3
266 #define espeakCHARS_16BIT  4
267 
268 #define espeakSSML        0x10
269 #define espeakPHONEMES    0x100
270 #define espeakENDPAUSE    0x1000
271 #define espeakKEEP_NAMEDATA 0x2000
272 
273 #ifdef __cplusplus
274 extern "C"
275 #endif
276 ESPEAK_API espeak_ERROR espeak_Synth(const void *text,
277 	size_t size,
278 	unsigned int position,
279 	espeak_POSITION_TYPE position_type,
280 	unsigned int end_position,
281 	unsigned int flags,
282 	unsigned int* unique_identifier,
283 	void* user_data);
284 /* Synthesize speech for the specified text.  The speech sound data is passed to the calling
285    program in buffers by means of the callback function specified by espeak_SetSynthCallback(). The command is asynchronous: it is internally buffered and returns as soon as possible. If espeak_Initialize was previously called with AUDIO_OUTPUT_PLAYBACK as argument, the sound data are played by eSpeak.
286 
287    text: The text to be spoken, terminated by a zero character. It may be either 8-bit characters,
288       wide characters (wchar_t), or UTF8 encoding.  Which of these is determined by the "flags"
289       parameter.
290 
291    size: Equal to (or greatrer than) the size of the text data, in bytes.  This is used in order
292       to allocate internal storage space for the text.  This value is not used for
293       AUDIO_OUTPUT_SYNCHRONOUS mode.
294 
295    position:  The position in the text where speaking starts. Zero indicates speak from the
296       start of the text.
297 
298    position_type:  Determines whether "position" is a number of characters, words, or sentences.
299       Values:
300 
301    end_position:  If set, this gives a character position at which speaking will stop.  A value
302       of zero indicates no end position.
303 
304    flags:  These may be OR'd together:
305       Type of character codes, one of:
306          espeakCHARS_UTF8     UTF8 encoding
307          espeakCHARS_8BIT     The 8 bit ISO-8859 character set for the particular language.
308          espeakCHARS_AUTO     8 bit or UTF8  (this is the default)
309          espeakCHARS_WCHAR    Wide characters (wchar_t)
310          espeakCHARS_16BIT    16 bit characters.
311 
312       espeakSSML   Elements within < > are treated as SSML elements, or if not recognised are ignored.
313 
314       espeakPHONEMES  Text within [[ ]] is treated as phonemes codes (in espeak's Hirshenbaum encoding).
315 
316       espeakENDPAUSE  If set then a sentence pause is added at the end of the text.  If not set then
317          this pause is suppressed.
318 
319    unique_identifier: This must be either NULL, or point to an integer variable to
320        which eSpeak writes a message identifier number.
321        eSpeak includes this number in espeak_EVENT messages which are the result of
322        this call of espeak_Synth().
323 
324    user_data: a pointer (or NULL) which will be passed to the callback function in
325        espeak_EVENT messages.
326 
327    Return: EE_OK: operation achieved
328            EE_BUFFER_FULL: the command can not be buffered;
329              you may try after a while to call the function again.
330 	   EE_INTERNAL_ERROR.
331 */
332 
333 #ifdef __cplusplus
334 extern "C"
335 #endif
336 ESPEAK_API espeak_ERROR espeak_Synth_Mark(const void *text,
337 	size_t size,
338 	const char *index_mark,
339 	unsigned int end_position,
340 	unsigned int flags,
341 	unsigned int* unique_identifier,
342 	void* user_data);
343 /* Synthesize speech for the specified text.  Similar to espeak_Synth() but the start position is
344    specified by the name of a <mark> element in the text.
345 
346    index_mark:  The "name" attribute of a <mark> element within the text which specified the
347       point at which synthesis starts.  UTF8 string.
348 
349    For the other parameters, see espeak_Synth()
350 
351    Return: EE_OK: operation achieved
352            EE_BUFFER_FULL: the command can not be buffered;
353              you may try after a while to call the function again.
354 	   EE_INTERNAL_ERROR.
355 */
356 
357 #ifdef __cplusplus
358 extern "C"
359 #endif
360 ESPEAK_API espeak_ERROR espeak_Key(const char *key_name);
361 /* Speak the name of a keyboard key.
362    If key_name is a single character, it speaks the name of the character.
363    Otherwise, it speaks key_name as a text string.
364 
365    Return: EE_OK: operation achieved
366            EE_BUFFER_FULL: the command can not be buffered;
367              you may try after a while to call the function again.
368 	   EE_INTERNAL_ERROR.
369 */
370 
371 #ifdef __cplusplus
372 extern "C"
373 #endif
374 ESPEAK_API espeak_ERROR espeak_Char(wchar_t character);
375 /* Speak the name of the given character
376 
377    Return: EE_OK: operation achieved
378            EE_BUFFER_FULL: the command can not be buffered;
379              you may try after a while to call the function again.
380 	   EE_INTERNAL_ERROR.
381 */
382 
383 
384 
385 
386          /***********************/
387          /*  Speech Parameters  */
388          /***********************/
389 
390 typedef enum {
391   espeakSILENCE=0, /* internal use */
392   espeakRATE=1,
393   espeakVOLUME=2,
394   espeakPITCH=3,
395   espeakRANGE=4,
396   espeakPUNCTUATION=5,
397   espeakCAPITALS=6,
398   espeakWORDGAP=7,
399   espeakOPTIONS=8,   // reserved for misc. options.  not yet used
400   espeakINTONATION=9,
401 
402   espeakRESERVED1=10,
403   espeakRESERVED2=11,
404   espeakEMPHASIS,   /* internal use */
405   espeakLINELENGTH, /* internal use */
406   espeakVOICETYPE,  // internal, 1=mbrola
407   N_SPEECH_PARAM    /* last enum */
408 } espeak_PARAMETER;
409 
410 typedef enum {
411   espeakPUNCT_NONE=0,
412   espeakPUNCT_ALL=1,
413   espeakPUNCT_SOME=2
414 } espeak_PUNCT_TYPE;
415 
416 #ifdef __cplusplus
417 extern "C"
418 #endif
419 ESPEAK_API espeak_ERROR espeak_SetParameter(espeak_PARAMETER parameter, int value, int relative);
420 /* Sets the value of the specified parameter.
421    relative=0   Sets the absolute value of the parameter.
422    relative=1   Sets a relative value of the parameter.
423 
424    parameter:
425       espeakRATE:    speaking speed in word per minute.  Values 80 to 450.
426 
427       espeakVOLUME:  volume in range 0-200 or more.
428                      0=silence, 100=normal full volume, greater values may produce amplitude compression or distortion
429 
430       espeakPITCH:   base pitch, range 0-100.  50=normal
431 
432       espeakRANGE:   pitch range, range 0-100. 0-monotone, 50=normal
433 
434       espeakPUNCTUATION:  which punctuation characters to announce:
435          value in espeak_PUNCT_TYPE (none, all, some),
436          see espeak_GetParameter() to specify which characters are announced.
437 
438       espeakCAPITALS: announce capital letters by:
439          0=none,
440          1=sound icon,
441          2=spelling,
442          3 or higher, by raising pitch.  This values gives the amount in Hz by which the pitch
443             of a word raised to indicate it has a capital letter.
444 
445       espeakWORDGAP:  pause between words, units of 10mS (at the default speed)
446 
447    Return: EE_OK: operation achieved
448            EE_BUFFER_FULL: the command can not be buffered;
449              you may try after a while to call the function again.
450 	   EE_INTERNAL_ERROR.
451 */
452 
453 #ifdef __cplusplus
454 extern "C"
455 #endif
456 ESPEAK_API int espeak_GetParameter(espeak_PARAMETER parameter, int current);
457 /* current=0  Returns the default value of the specified parameter.
458    current=1  Returns the current value of the specified parameter, as set by SetParameter()
459 */
460 
461 #ifdef __cplusplus
462 extern "C"
463 #endif
464 ESPEAK_API espeak_ERROR espeak_SetPunctuationList(const wchar_t *punctlist);
465 /* Specified a list of punctuation characters whose names are to be spoken when the
466    value of the Punctuation parameter is set to "some".
467 
468    punctlist:  A list of character codes, terminated by a zero character.
469 
470    Return: EE_OK: operation achieved
471            EE_BUFFER_FULL: the command can not be buffered;
472              you may try after a while to call the function again.
473 	   EE_INTERNAL_ERROR.
474 */
475 
476 #ifdef __cplusplus
477 extern "C"
478 #endif
479 ESPEAK_API void espeak_SetPhonemeTrace(int value, FILE *stream);
480 /* Controls the output of phoneme symbols for the text
481    value=0  No phoneme output (default)
482    value=1  Output the translated phoneme symbols for the text
483    value=2  as (1), but also output a trace of how the translation was done (matching rules and list entries)
484    value=3  as (1), but produces IPA rather than ascii phoneme names
485 
486    stream   output stream for the phoneme symbols (and trace).  If stream=NULL then it uses stdout.
487 */
488 
489 #ifdef __cplusplus
490 extern "C"
491 #endif
492 ESPEAK_API const char *espeak_TextToPhonemes(const void **textptr, int textmode, int phonememode);
493 /* Translates text into phonemes.  Call espeak_SetVoiceByName() first, to select a language.
494 
495    It returns a pointer to a character string which contains the phonemes for the text up to
496    end of a sentence, or comma, semicolon, colon, or similar punctuation.
497 
498    textptr: The address of a pointer to the input text which is terminated by a zero character.
499       On return, the pointer has been advanced past the text which has been translated, or else set
500       to NULL to indicate that the end of the text has been reached.
501 
502    textmode: Type of character codes, one of:
503          espeakCHARS_UTF8     UTF8 encoding
504          espeakCHARS_8BIT     The 8 bit ISO-8859 character set for the particular language.
505          espeakCHARS_AUTO     8 bit or UTF8  (this is the default)
506          espeakCHARS_WCHAR    Wide characters (wchar_t)
507          espeakCHARS_16BIT    16 bit characters.
508 
509    phonememode: bits0-3:
510       0= just phonemes.
511       1= include ties (U+361) for phoneme names of more than one letter.
512       2= include zero-width-joiner for phoneme names of more than one letter.
513       3= separate phonemes with underscore characters.
514 
515 	 bits 4-7:
516       0= eSpeak's ascii phoneme names.
517       1= International Phonetic Alphabet (as UTF-8 characters).
518 */
519 
520 #ifdef __cplusplus
521 extern "C"
522 #endif
523 ESPEAK_API void espeak_CompileDictionary(const char *path, FILE *log, int flags);
524 /* Compile pronunciation dictionary for a language which corresponds to the currently
525    selected voice.  The required voice should be selected before calling this function.
526 
527    path:  The directory which contains the language's '_rules' and '_list' files.
528           'path' should end with a path separator character ('/').
529    log:   Stream for error reports and statistics information. If log=NULL then stderr will be used.
530 
531    flags:  Bit 0: include source line information for debug purposes (This is displayed with the
532           -X command line option).
533 */
534          /***********************/
535          /*   Voice Selection   */
536          /***********************/
537 
538 
539 // voice table
540 typedef struct {
541 	const char *name;      // a given name for this voice. UTF8 string.
542 	const char *languages;       // list of pairs of (byte) priority + (string) language (and dialect qualifier)
543 	const char *identifier;      // the filename for this voice within espeak-data/voices
544 	unsigned char gender;  // 0=none 1=male, 2=female,
545 	unsigned char age;     // 0=not specified, or age in years
546 	unsigned char variant; // only used when passed as a parameter to espeak_SetVoiceByProperties
547 	unsigned char xx1;     // for internal use
548 	int score;       // for internal use
549 	void *spare;     // for internal use
550 } espeak_VOICE;
551 
552 /* Note: The espeak_VOICE structure is used for two purposes:
553   1.  To return the details of the available voices.
554   2.  As a parameter to  espeak_SetVoiceByProperties() in order to specify selection criteria.
555 
556    In (1), the "languages" field consists of a list of (UTF8) language names for which this voice
557    may be used, each language name in the list is terminated by a zero byte and is also preceded by
558    a single byte which gives a "priority" number.  The list of languages is terminated by an
559    additional zero byte.
560 
561    A language name consists of a language code, optionally followed by one or more qualifier (dialect)
562    names separated by hyphens (eg. "en-uk").  A voice might, for example, have languages "en-uk" and
563    "en".  Even without "en" listed, voice would still be selected for the "en" language (because
564    "en-uk" is related) but at a lower priority.
565 
566    The priority byte indicates how the voice is preferred for the language. A low number indicates a
567    more preferred voice, a higher number indicates a less preferred voice.
568 
569    In (2), the "languages" field consists simply of a single (UTF8) language name, with no preceding
570    priority byte.
571 */
572 
573 #ifdef __cplusplus
574 extern "C"
575 #endif
576 ESPEAK_API const espeak_VOICE **espeak_ListVoices(espeak_VOICE *voice_spec);
577 /* Reads the voice files from espeak-data/voices and creates an array of espeak_VOICE pointers.
578    The list is terminated by a NULL pointer
579 
580    If voice_spec is NULL then all voices are listed.
581    If voice spec is given, then only the voices which are compatible with the voice_spec
582    are listed, and they are listed in preference order.
583 */
584 
585 #ifdef __cplusplus
586 extern "C"
587 #endif
588 ESPEAK_API espeak_ERROR espeak_SetVoiceByName(const char *name);
589 /* Searches for a voice with a matching "name" field.  Language is not considered.
590    "name" is a UTF8 string.
591 
592    Return: EE_OK: operation achieved
593            EE_BUFFER_FULL: the command can not be buffered;
594              you may try after a while to call the function again.
595 	   EE_INTERNAL_ERROR.
596 */
597 
598 #ifdef __cplusplus
599 extern "C"
600 #endif
601 ESPEAK_API espeak_ERROR espeak_SetVoiceByProperties(espeak_VOICE *voice_spec);
602 /* An espeak_VOICE structure is used to pass criteria to select a voice.  Any of the following
603    fields may be set:
604 
605    name     NULL, or a voice name
606 
607    languages  NULL, or a single language string (with optional dialect), eg. "en-uk", or "en"
608 
609    gender   0=not specified, 1=male, 2=female
610 
611    age      0=not specified, or an age in years
612 
613    variant  After a list of candidates is produced, scored and sorted, "variant" is used to index
614             that list and choose a voice.
615             variant=0 takes the top voice (i.e. best match). variant=1 takes the next voice, etc
616 */
617 
618 #ifdef __cplusplus
619 extern "C"
620 #endif
621 ESPEAK_API espeak_VOICE *espeak_GetCurrentVoice(void);
622 /* Returns the espeak_VOICE data for the currently selected voice.
623    This is not affected by temporary voice changes caused by SSML elements such as <voice> and <s>
624 */
625 
626 #ifdef __cplusplus
627 extern "C"
628 #endif
629 ESPEAK_API espeak_ERROR espeak_Cancel(void);
630 /* Stop immediately synthesis and audio output of the current text. When this
631    function returns, the audio output is fully stopped and the synthesizer is ready to
632    synthesize a new message.
633 
634    Return: EE_OK: operation achieved
635 	   EE_INTERNAL_ERROR.
636 */
637 
638 
639 #ifdef __cplusplus
640 extern "C"
641 #endif
642 ESPEAK_API int espeak_IsPlaying(void);
643 /* Returns 1 if audio is played, 0 otherwise.
644 */
645 
646 #ifdef __cplusplus
647 extern "C"
648 #endif
649 ESPEAK_API espeak_ERROR espeak_Synchronize(void);
650 /* This function returns when all data have been spoken.
651    Return: EE_OK: operation achieved
652 	   EE_INTERNAL_ERROR.
653 */
654 
655 #ifdef __cplusplus
656 extern "C"
657 #endif
658 ESPEAK_API espeak_ERROR espeak_Terminate(void);
659 /* last function to be called.
660    Return: EE_OK: operation achieved
661 	   EE_INTERNAL_ERROR.
662 */
663 
664 
665 #ifdef __cplusplus
666 extern "C"
667 #endif
668 ESPEAK_API const char *espeak_Info(const char **path_data);
669 /* Returns the version number string.
670    path_data  returns the path to espeak_data
671 */
672 #endif
673