~ubuntu-branches/ubuntu/oneiric/espeak/oneiric

« back to all changes in this revision

Viewing changes to src/speak_lib.h

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2011-05-04 11:25:46 UTC
  • mfrom: (1.1.24 upstream) (5.1.10 sid)
  • Revision ID: james.westby@ubuntu.com-20110504112546-ykijzihgc7ybgzn2
Tags: 1.45.04-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Add gbp.conf for use with git buildpackage
  - Update the explanation of the -b command-line flag in the espeak manpage

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include <stdio.h>
29
29
#include <stddef.h>
30
30
 
 
31
#ifdef __WIN32__
 
32
#define ESPEAK_API __declspec(dllexport)
 
33
#else
 
34
#define ESPEAK_API
 
35
#endif
 
36
 
31
37
#define ESPEAK_API_REVISION  6
32
38
/*
33
39
Revision 2
157
163
        EE_NOT_FOUND=2
158
164
} espeak_ERROR;
159
165
 
 
166
#define espeakINITIALIZE_PHONEME_EVENTS 0x0001
 
167
#define espeakINITIALIZE_DONT_EXIT     0x8000
160
168
 
161
169
#ifdef __cplusplus
162
170
extern "C"
163
171
#endif
164
 
int espeak_Initialize(espeak_AUDIO_OUTPUT output, int buflength, const char *path, int options);
 
172
ESPEAK_API int espeak_Initialize(espeak_AUDIO_OUTPUT output, int buflength, const char *path, int options);
165
173
/* Must be called before any synthesis functions are called.
166
174
   output: the audio data can either be played by eSpeak or passed back by the SynthCallback function.
167
175
 
169
177
 
170
178
   path: The directory which contains the espeak-data directory, or NULL for the default location.
171
179
 
172
 
   options: bit 0: 1=allow espeakEVENT_PHONEME events.
173
 
 
 
180
   options: bit 0:  1=allow espeakEVENT_PHONEME events.
 
181
            bit 15: 1=don't exit if espeak_data is not found (used for --help)
174
182
 
175
183
   Returns: sample rate in Hz, or -1 (EE_INTERNAL_ERROR).
176
184
*/
180
188
#ifdef __cplusplus
181
189
extern "C"
182
190
#endif
183
 
void espeak_SetSynthCallback(t_espeak_callback* SynthCallback);
 
191
ESPEAK_API void espeak_SetSynthCallback(t_espeak_callback* SynthCallback);
184
192
/* Must be called before any synthesis functions are called.
185
193
   This specifies a function in the calling program which is called when a buffer of
186
194
   speech sound data has been produced. 
208
216
#ifdef __cplusplus
209
217
extern "C"
210
218
#endif
211
 
void espeak_SetUriCallback(int (*UriCallback)(int, const char*, const char*));
 
219
ESPEAK_API void espeak_SetUriCallback(int (*UriCallback)(int, const char*, const char*));
212
220
/* This function may be called before synthesis functions are used, in order to deal with
213
221
   <audio> tags.  It specifies a callback function which is called when an <audio> element is
214
222
   encountered and allows the calling program to indicate whether the sound file which
249
257
#ifdef __cplusplus
250
258
extern "C"
251
259
#endif
252
 
espeak_ERROR espeak_Synth(const void *text,
 
260
ESPEAK_API espeak_ERROR espeak_Synth(const void *text,
253
261
        size_t size,
254
262
        unsigned int position,
255
263
        espeak_POSITION_TYPE position_type,
305
313
#ifdef __cplusplus
306
314
extern "C"
307
315
#endif
308
 
espeak_ERROR espeak_Synth_Mark(const void *text,
 
316
ESPEAK_API espeak_ERROR espeak_Synth_Mark(const void *text,
309
317
        size_t size,
310
318
        const char *index_mark,
311
319
        unsigned int end_position,
329
337
#ifdef __cplusplus
330
338
extern "C"
331
339
#endif
332
 
espeak_ERROR espeak_Key(const char *key_name);
 
340
ESPEAK_API espeak_ERROR espeak_Key(const char *key_name);
333
341
/* Speak the name of a keyboard key.
334
342
   If key_name is a single character, it speaks the name of the character.
335
343
   Otherwise, it speaks key_name as a text string.
343
351
#ifdef __cplusplus
344
352
extern "C"
345
353
#endif
346
 
espeak_ERROR espeak_Char(wchar_t character);
 
354
ESPEAK_API espeak_ERROR espeak_Char(wchar_t character);
347
355
/* Speak the name of the given character 
348
356
 
349
357
   Return: EE_OK: operation achieved 
388
396
#ifdef __cplusplus
389
397
extern "C"
390
398
#endif
391
 
espeak_ERROR espeak_SetParameter(espeak_PARAMETER parameter, int value, int relative);
 
399
ESPEAK_API espeak_ERROR espeak_SetParameter(espeak_PARAMETER parameter, int value, int relative);
392
400
/* Sets the value of the specified parameter.
393
401
   relative=0   Sets the absolute value of the parameter.
394
402
   relative=1   Sets a relative value of the parameter.
425
433
#ifdef __cplusplus
426
434
extern "C"
427
435
#endif
428
 
int espeak_GetParameter(espeak_PARAMETER parameter, int current);
 
436
ESPEAK_API int espeak_GetParameter(espeak_PARAMETER parameter, int current);
429
437
/* current=0  Returns the default value of the specified parameter.
430
438
   current=1  Returns the current value of the specified parameter, as set by SetParameter()
431
439
*/
433
441
#ifdef __cplusplus
434
442
extern "C"
435
443
#endif
436
 
espeak_ERROR espeak_SetPunctuationList(const wchar_t *punctlist);
 
444
ESPEAK_API espeak_ERROR espeak_SetPunctuationList(const wchar_t *punctlist);
437
445
/* Specified a list of punctuation characters whose names are to be spoken when the
438
446
   value of the Punctuation parameter is set to "some".
439
447
 
448
456
#ifdef __cplusplus
449
457
extern "C"
450
458
#endif
451
 
void espeak_SetPhonemeTrace(int value, FILE *stream);
 
459
ESPEAK_API void espeak_SetPhonemeTrace(int value, FILE *stream);
452
460
/* Controls the output of phoneme symbols for the text
453
461
   value=0  No phoneme output (default)
454
462
   value=1  Output the translated phoneme symbols for the text
461
469
#ifdef __cplusplus
462
470
extern "C"
463
471
#endif
464
 
void espeak_CompileDictionary(const char *path, FILE *log, int flags);
 
472
ESPEAK_API void espeak_CompileDictionary(const char *path, FILE *log, int flags);
465
473
/* Compile pronunciation dictionary for a language which corresponds to the currently
466
474
   selected voice.  The required voice should be selected before calling this function.
467
475
 
514
522
#ifdef __cplusplus
515
523
extern "C"
516
524
#endif
517
 
const espeak_VOICE **espeak_ListVoices(espeak_VOICE *voice_spec);
 
525
ESPEAK_API const espeak_VOICE **espeak_ListVoices(espeak_VOICE *voice_spec);
518
526
/* Reads the voice files from espeak-data/voices and creates an array of espeak_VOICE pointers.
519
527
   The list is terminated by a NULL pointer
520
528
 
526
534
#ifdef __cplusplus
527
535
extern "C"
528
536
#endif
529
 
espeak_ERROR espeak_SetVoiceByName(const char *name);
 
537
ESPEAK_API espeak_ERROR espeak_SetVoiceByName(const char *name);
530
538
/* Searches for a voice with a matching "name" field.  Language is not considered.
531
539
   "name" is a UTF8 string.
532
540
 
539
547
#ifdef __cplusplus
540
548
extern "C"
541
549
#endif
542
 
espeak_ERROR espeak_SetVoiceByProperties(espeak_VOICE *voice_spec);
 
550
ESPEAK_API espeak_ERROR espeak_SetVoiceByProperties(espeak_VOICE *voice_spec);
543
551
/* An espeak_VOICE structure is used to pass criteria to select a voice.  Any of the following
544
552
   fields may be set:
545
553
 
559
567
#ifdef __cplusplus
560
568
extern "C"
561
569
#endif
562
 
espeak_VOICE *espeak_GetCurrentVoice(void);
 
570
ESPEAK_API espeak_VOICE *espeak_GetCurrentVoice(void);
563
571
/* Returns the espeak_VOICE data for the currently selected voice.
564
572
   This is not affected by temporary voice changes caused by SSML elements such as <voice> and <s>
565
573
*/
567
575
#ifdef __cplusplus
568
576
extern "C"
569
577
#endif
570
 
espeak_ERROR espeak_Cancel(void);
 
578
ESPEAK_API espeak_ERROR espeak_Cancel(void);
571
579
/* Stop immediately synthesis and audio output of the current text. When this
572
580
   function returns, the audio output is fully stopped and the synthesizer is ready to
573
581
   synthesize a new message.
580
588
#ifdef __cplusplus
581
589
extern "C"
582
590
#endif
583
 
int espeak_IsPlaying(void);
 
591
ESPEAK_API int espeak_IsPlaying(void);
584
592
/* Returns 1 if audio is played, 0 otherwise.
585
593
*/
586
594
 
587
595
#ifdef __cplusplus
588
596
extern "C"
589
597
#endif
590
 
espeak_ERROR espeak_Synchronize(void);
 
598
ESPEAK_API espeak_ERROR espeak_Synchronize(void);
591
599
/* This function returns when all data have been spoken.
592
600
   Return: EE_OK: operation achieved 
593
601
           EE_INTERNAL_ERROR.
596
604
#ifdef __cplusplus
597
605
extern "C"
598
606
#endif
599
 
espeak_ERROR espeak_Terminate(void);
 
607
ESPEAK_API espeak_ERROR espeak_Terminate(void);
600
608
/* last function to be called.
601
609
   Return: EE_OK: operation achieved 
602
610
           EE_INTERNAL_ERROR.
606
614
#ifdef __cplusplus
607
615
extern "C"
608
616
#endif
609
 
const char *espeak_Info(void* ptr);
 
617
ESPEAK_API const char *espeak_Info(const char **path_data);
610
618
/* Returns the version number string.
611
 
   The parameter is for future use, and should be set to NULL
 
619
   path_data  returns the path to espeak_data
612
620
*/
613
621
#endif