~ubuntu-branches/ubuntu/trusty/espeak/trusty

« back to all changes in this revision

Viewing changes to platforms/windows/windows_dll/src/speak_lib.h

  • Committer: Bazaar Package Importer
  • Author(s): Samuel Thibault, Luke Yelavich, Mario Lang, Nicolas Boulenguez, Samuel Thibault
  • Date: 2011-01-30 20:41:59 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20110130204159-l034urxudcsruok8
Tags: 1.44.05-1
[ Luke Yelavich ]
* debian/copyright: update
* Update manpage to add command-line flags and fix some errors

[ Mario Lang ]
* New upstream version (Closes: Bug#594872)

[ Nicolas Boulenguez ]
* Made the html docs a subdir.
* Referenced it in doc-base.
* Correct syntax in manpage.
* Separate common paragraph of each description, to ease translations.
* Remove empty postinst and postrm.
* Add ${misc:Depends} to espeak-data-udeb, update the description to mention
  d-i.
* Use Package-Type instead of XC-Package-Type.

[ Samuel Thibault ]
* debian/copyright: Fix Jonathan's mail.
* debian/control: Add espeak-dbg package.
* debian/rules: Put debugging symbols into espeak-dbg (Closes: Bug#608984).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#ifndef SPEAK_LIB_H
2
2
#define SPEAK_LIB_H
3
3
/***************************************************************************
4
 
 *   Copyright (C) 2005 to 2007 by Jonathan Duddington                     *
 
4
 *   Copyright (C) 2005 to 2010 by Jonathan Duddington                     *
5
5
 *   email: jonsd@users.sourceforge.net                                    *
6
6
 *                                                                         *
7
7
 *   This program is free software; you can redistribute it and/or modify  *
24
24
/* This is the header file for the library version of espeak */
25
25
/*                                                           */
26
26
/*************************************************************/
27
 
#define ESPEAK_API __declspec(dllexport)
28
27
 
29
28
#include <stdio.h>
 
29
#include <stddef.h>
30
30
 
31
 
#define ESPEAK_API_REVISION  5
 
31
#define ESPEAK_API_REVISION  6
32
32
/*
33
33
Revision 2
34
34
   Added parameter "options" to eSpeakInitialize()
41
41
 
42
42
Revision 5
43
43
   Added espeakCHARS_16BIT
 
44
 
 
45
Revision 6
 
46
  Added macros: espeakRATE_MINIMUM, espeakRATE_MAXIMUM, espeakRATE_NORMAL
44
47
*/
45
48
         /********************/
46
49
         /*  Initialization  */
47
50
         /********************/
48
51
 
 
52
// values for 'value' in espeak_SetParameter(espeakRATE, value, 0), nominally in words-per-minute
 
53
#define espeakRATE_MINIMUM  80
 
54
#define espeakRATE_MAXIMUM  450
 
55
#define espeakRATE_NORMAL   175
 
56
 
49
57
 
50
58
typedef enum {
51
59
  espeakEVENT_LIST_TERMINATED = 0, // Retrieval mode: terminates the event list.
52
60
  espeakEVENT_WORD = 1,            // Start of word
53
 
  espeakEVENT_SENTENCE,            // Start of sentence
54
 
  espeakEVENT_MARK,                // Mark
55
 
  espeakEVENT_PLAY,                // Audio element
56
 
  espeakEVENT_END,                 // End of sentence or clause
57
 
  espeakEVENT_MSG_TERMINATED,      // End of message
58
 
  espeakEVENT_PHONEME              // Phoneme, if enabled in espeak_Initialize()
 
61
  espeakEVENT_SENTENCE = 2,        // Start of sentence
 
62
  espeakEVENT_MARK = 3,            // Mark
 
63
  espeakEVENT_PLAY = 4,            // Audio element
 
64
  espeakEVENT_END = 5,             // End of sentence or clause
 
65
  espeakEVENT_MSG_TERMINATED = 6,  // End of message
 
66
  espeakEVENT_PHONEME = 7,         // Phoneme, if enabled in espeak_Initialize()
 
67
  espeakEVENT_SAMPLERATE = 8       // internal use, set sample rate
59
68
} espeak_EVENT_TYPE;
60
69
 
61
70
 
152
161
#ifdef __cplusplus
153
162
extern "C"
154
163
#endif
155
 
ESPEAK_API int espeak_Initialize(espeak_AUDIO_OUTPUT output, int buflength, const char *path, int options);
 
164
int espeak_Initialize(espeak_AUDIO_OUTPUT output, int buflength, const char *path, int options);
156
165
/* Must be called before any synthesis functions are called.
157
166
   output: the audio data can either be played by eSpeak or passed back by the SynthCallback function.
158
167
 
171
180
#ifdef __cplusplus
172
181
extern "C"
173
182
#endif
174
 
ESPEAK_API void espeak_SetSynthCallback(t_espeak_callback* SynthCallback);
 
183
void espeak_SetSynthCallback(t_espeak_callback* SynthCallback);
175
184
/* Must be called before any synthesis functions are called.
176
185
   This specifies a function in the calling program which is called when a buffer of
177
186
   speech sound data has been produced. 
199
208
#ifdef __cplusplus
200
209
extern "C"
201
210
#endif
202
 
ESPEAK_API void espeak_SetUriCallback(int (*UriCallback)(int, const char*, const char*));
 
211
void espeak_SetUriCallback(int (*UriCallback)(int, const char*, const char*));
203
212
/* This function may be called before synthesis functions are used, in order to deal with
204
213
   <audio> tags.  It specifies a callback function which is called when an <audio> element is
205
214
   encountered and allows the calling program to indicate whether the sound file which
240
249
#ifdef __cplusplus
241
250
extern "C"
242
251
#endif
243
 
ESPEAK_API espeak_ERROR espeak_Synth(const void *text,
 
252
espeak_ERROR espeak_Synth(const void *text,
244
253
        size_t size,
245
254
        unsigned int position,
246
255
        espeak_POSITION_TYPE position_type,
296
305
#ifdef __cplusplus
297
306
extern "C"
298
307
#endif
299
 
ESPEAK_API espeak_ERROR espeak_Synth_Mark(const void *text,
 
308
espeak_ERROR espeak_Synth_Mark(const void *text,
300
309
        size_t size,
301
310
        const char *index_mark,
302
311
        unsigned int end_position,
320
329
#ifdef __cplusplus
321
330
extern "C"
322
331
#endif
323
 
ESPEAK_API espeak_ERROR espeak_Key(const char *key_name);
 
332
espeak_ERROR espeak_Key(const char *key_name);
324
333
/* Speak the name of a keyboard key.
325
334
   If key_name is a single character, it speaks the name of the character.
326
335
   Otherwise, it speaks key_name as a text string.
334
343
#ifdef __cplusplus
335
344
extern "C"
336
345
#endif
337
 
ESPEAK_API espeak_ERROR espeak_Char(wchar_t character);
 
346
espeak_ERROR espeak_Char(wchar_t character);
338
347
/* Speak the name of the given character 
339
348
 
340
349
   Return: EE_OK: operation achieved 
379
388
#ifdef __cplusplus
380
389
extern "C"
381
390
#endif
382
 
ESPEAK_API espeak_ERROR espeak_SetParameter(espeak_PARAMETER parameter, int value, int relative);
 
391
espeak_ERROR espeak_SetParameter(espeak_PARAMETER parameter, int value, int relative);
383
392
/* Sets the value of the specified parameter.
384
393
   relative=0   Sets the absolute value of the parameter.
385
394
   relative=1   Sets a relative value of the parameter.
386
395
 
387
396
   parameter:
388
 
      espeakRATE:    speaking speed in word per minute.
 
397
      espeakRATE:    speaking speed in word per minute.  Values 80 to 450.
389
398
 
390
 
      espeakVOLUME:  volume in range 0-100    0=silence
 
399
      espeakVOLUME:  volume in range 0-200 or more.
 
400
                     0=silence, 100=normal full volume, greater values may produce amplitude compression or distortion
391
401
 
392
402
      espeakPITCH:   base pitch, range 0-100.  50=normal
393
403
 
415
425
#ifdef __cplusplus
416
426
extern "C"
417
427
#endif
418
 
ESPEAK_API int espeak_GetParameter(espeak_PARAMETER parameter, int current);
 
428
int espeak_GetParameter(espeak_PARAMETER parameter, int current);
419
429
/* current=0  Returns the default value of the specified parameter.
420
430
   current=1  Returns the current value of the specified parameter, as set by SetParameter()
421
431
*/
423
433
#ifdef __cplusplus
424
434
extern "C"
425
435
#endif
426
 
ESPEAK_API espeak_ERROR espeak_SetPunctuationList(const wchar_t *punctlist);
 
436
espeak_ERROR espeak_SetPunctuationList(const wchar_t *punctlist);
427
437
/* Specified a list of punctuation characters whose names are to be spoken when the
428
438
   value of the Punctuation parameter is set to "some".
429
439
 
438
448
#ifdef __cplusplus
439
449
extern "C"
440
450
#endif
441
 
ESPEAK_API void espeak_SetPhonemeTrace(int value, FILE *stream);
 
451
void espeak_SetPhonemeTrace(int value, FILE *stream);
442
452
/* Controls the output of phoneme symbols for the text
443
453
   value=0  No phoneme output (default)
444
454
   value=1  Output the translated phoneme symbols for the text
445
455
   value=2  as (1), but also output a trace of how the translation was done (matching rules and list entries)
 
456
   value=3  as (1), but produces IPA rather than ascii phoneme names
446
457
 
447
458
   stream   output stream for the phoneme symbols (and trace).  If stream=NULL then it uses stdout.
448
459
*/
450
461
#ifdef __cplusplus
451
462
extern "C"
452
463
#endif
453
 
ESPEAK_API void espeak_CompileDictionary(const char *path, FILE *log, int flags);
 
464
void espeak_CompileDictionary(const char *path, FILE *log, int flags);
454
465
/* Compile pronunciation dictionary for a language which corresponds to the currently
455
466
   selected voice.  The required voice should be selected before calling this function.
456
467
 
503
514
#ifdef __cplusplus
504
515
extern "C"
505
516
#endif
506
 
ESPEAK_API const espeak_VOICE **espeak_ListVoices(espeak_VOICE *voice_spec);
 
517
const espeak_VOICE **espeak_ListVoices(espeak_VOICE *voice_spec);
507
518
/* Reads the voice files from espeak-data/voices and creates an array of espeak_VOICE pointers.
508
519
   The list is terminated by a NULL pointer
509
520
 
510
521
   If voice_spec is NULL then all voices are listed.
511
 
   If voice spec is give, then only the voices which are compatible with the voice_spec
 
522
   If voice spec is given, then only the voices which are compatible with the voice_spec
512
523
   are listed, and they are listed in preference order.
513
524
*/
514
525
 
515
526
#ifdef __cplusplus
516
527
extern "C"
517
528
#endif
518
 
ESPEAK_API espeak_ERROR espeak_SetVoiceByName(const char *name);
 
529
espeak_ERROR espeak_SetVoiceByName(const char *name);
519
530
/* Searches for a voice with a matching "name" field.  Language is not considered.
520
531
   "name" is a UTF8 string.
521
532
 
528
539
#ifdef __cplusplus
529
540
extern "C"
530
541
#endif
531
 
ESPEAK_API espeak_ERROR espeak_SetVoiceByProperties(espeak_VOICE *voice_spec);
 
542
espeak_ERROR espeak_SetVoiceByProperties(espeak_VOICE *voice_spec);
532
543
/* An espeak_VOICE structure is used to pass criteria to select a voice.  Any of the following
533
544
   fields may be set:
534
545
 
548
559
#ifdef __cplusplus
549
560
extern "C"
550
561
#endif
551
 
ESPEAK_API espeak_VOICE *espeak_GetCurrentVoice(void);
 
562
espeak_VOICE *espeak_GetCurrentVoice(void);
552
563
/* Returns the espeak_VOICE data for the currently selected voice.
553
564
   This is not affected by temporary voice changes caused by SSML elements such as <voice> and <s>
554
565
*/
556
567
#ifdef __cplusplus
557
568
extern "C"
558
569
#endif
559
 
ESPEAK_API espeak_ERROR espeak_Cancel(void);
 
570
espeak_ERROR espeak_Cancel(void);
560
571
/* Stop immediately synthesis and audio output of the current text. When this
561
572
   function returns, the audio output is fully stopped and the synthesizer is ready to
562
573
   synthesize a new message.
569
580
#ifdef __cplusplus
570
581
extern "C"
571
582
#endif
572
 
ESPEAK_API int espeak_IsPlaying(void);
 
583
int espeak_IsPlaying(void);
573
584
/* Returns 1 if audio is played, 0 otherwise.
574
585
*/
575
586
 
576
587
#ifdef __cplusplus
577
588
extern "C"
578
589
#endif
579
 
ESPEAK_API espeak_ERROR espeak_Synchronize(void);
 
590
espeak_ERROR espeak_Synchronize(void);
580
591
/* This function returns when all data have been spoken.
581
592
   Return: EE_OK: operation achieved 
582
593
           EE_INTERNAL_ERROR.
585
596
#ifdef __cplusplus
586
597
extern "C"
587
598
#endif
588
 
ESPEAK_API espeak_ERROR espeak_Terminate(void);
 
599
espeak_ERROR espeak_Terminate(void);
589
600
/* last function to be called.
590
601
   Return: EE_OK: operation achieved 
591
602
           EE_INTERNAL_ERROR.
595
606
#ifdef __cplusplus
596
607
extern "C"
597
608
#endif
598
 
ESPEAK_API const char *espeak_Info(void* ptr);
 
609
const char *espeak_Info(void* ptr);
599
610
/* Returns the version number string.
600
611
   The parameter is for future use, and should be set to NULL
601
612
*/