From fbe9539748fda97161ffa36337a1f10c93e36e03 Mon Sep 17 00:00:00 2001 From: jonsd Date: Thu, 14 Mar 2013 00:34:12 +0000 Subject: [PATCH 1/2] [1.46.49] Fix: character names sometimes not spoken correctly if they are from another language's dictionary. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@315 d46cf337-b52f-0410-862d-fd96e6ae7743 --- src/phonemelist.cpp | 9 ++++++--- src/readclause.cpp | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/phonemelist.cpp b/src/phonemelist.cpp index 1e39610f..a0c3f9d4 100644 --- a/src/phonemelist.cpp +++ b/src/phonemelist.cpp @@ -341,10 +341,13 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence) ph = phoneme_tab[plist3->phcode]; plist3[0].ph = ph; - if((plist3->phcode == phonSWITCH) && !(plist3->synthflags & SFLAG_EMBEDDED)) // ?? phonSWITCH can't have SFLAG_EMBEDDED ?? + if(plist3->phcode == phonSWITCH) { - if((plist3[1].phcode == phonSWITCH) || ((plist3[1].type == phPAUSE) && (plist3[2].phcode == phonSWITCH))) - continue; // next phoneme is also a phonSWITCH, so ignore + if(!(plist3->synthflags & SFLAG_EMBEDDED)) // ?? phonSWITCH can't have SFLAG_EMBEDDED ?? + { + if((plist3[1].phcode == phonSWITCH) || ((plist3[1].type == phPAUSE) && (plist3[2].phcode == phonSWITCH))) + continue; // next phoneme is also a phonSWITCH, so ignore + } // change phoneme table SelectPhonemeTable(plist3->tone_ph); diff --git a/src/readclause.cpp b/src/readclause.cpp index 785356ed..b701d854 100644 --- a/src/readclause.cpp +++ b/src/readclause.cpp @@ -643,7 +643,7 @@ static const char *LookupCharName(Translator *tr, int c, int only) } } - if((only==0) && (phonemes[0] == 0) && (tr->translator_name != L('e','n'))) + if((only==0) && ((phonemes[0] == 0) || (phonemes[0] == phonSWITCH)) && (tr->translator_name != L('e','n'))) { // not found, try English SetTranslator2("en"); From d695786e5438f023a36eb5e91feb4df4e13bc19e Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Thu, 14 Mar 2013 11:04:59 +0000 Subject: [PATCH 2/2] 1.46.49 (from http://espeak.sourceforge.net/test/latest.html) --- dictsource/hi_list | 2 +- dictsource/hi_rules | 2 +- docs/phonemes.html | 11 +++++---- docs/speak_lib.h | 56 ++++++++++++++++++++++++++------------------- 4 files changed, 40 insertions(+), 31 deletions(-) diff --git a/dictsource/hi_list b/dictsource/hi_list index e28b4e50..ee9eb364 100644 --- a/dictsource/hi_list +++ b/dictsource/hi_list @@ -162,7 +162,7 @@ _dpt _d@s@ml'o:_ // ?? what is Hi for "." ? श S@ ष s.@ // retroflex [S] स s@ -ह H@- +ह H@ क़ q@ ख़ x@ ग़ Q@ diff --git a/dictsource/hi_rules b/dictsource/hi_rules index ffbd8801..9144dc17 100644 --- a/dictsource/hi_rules +++ b/dictsource/hi_rules @@ -346,7 +346,7 @@ स (B s .group ह - ह H + ह HV ह (B H diff --git a/docs/phonemes.html b/docs/phonemes.html index 0c3f80e4..c0ab5fc7 100644 --- a/docs/phonemes.html +++ b/docs/phonemes.html @@ -24,8 +24,8 @@ Phoneme mnemonics can be used directly in the text input to espeak -[p] -[b] +[p] +[b] [t] [d] @@ -92,7 +92,7 @@ In rhotic accents, such as General American, the phonemes [3:], [A@], [e@]
[@] -alphaschwa +alphaschwa
[3] betterrhotic schwa. In British English this is the same as [@], but it includes 'r' colouring in American and other rhotic accents. In these cases a separate [r] should not be included unless it is followed immediately by another vowel. @@ -105,7 +105,7 @@ In rhotic accents, such as General American, the phonemes [3:], [A@], [e@]
[a]trap
[aa]bathThis is [a] in some accents, [A:] in others. -
[a2]aboutThis may be [@] or may be a more open schwa. +
[a#]aboutThis may be [@] or may be a more open schwa.
[A:]palm
[A@]start

@@ -161,7 +161,8 @@ Other languages will have their own vowel definitions, eg:

- +

+ [:] can be used to lengthen a vowel, eg [e:] diff --git a/docs/speak_lib.h b/docs/speak_lib.h index 9ca01f59..8cf7f807 100644 --- a/docs/speak_lib.h +++ b/docs/speak_lib.h @@ -28,6 +28,12 @@ #include #include +#ifdef __WIN32__ +#define ESPEAK_API __declspec(dllexport) +#else +#define ESPEAK_API +#endif + #define ESPEAK_API_REVISION 6 /* Revision 2 @@ -157,11 +163,13 @@ typedef enum { EE_NOT_FOUND=2 } espeak_ERROR; +#define espeakINITIALIZE_PHONEME_EVENTS 0x0001 +#define espeakINITIALIZE_DONT_EXIT 0x8000 #ifdef __cplusplus extern "C" #endif -int espeak_Initialize(espeak_AUDIO_OUTPUT output, int buflength, const char *path, int options); +ESPEAK_API int espeak_Initialize(espeak_AUDIO_OUTPUT output, int buflength, const char *path, int options); /* Must be called before any synthesis functions are called. output: the audio data can either be played by eSpeak or passed back by the SynthCallback function. @@ -169,8 +177,8 @@ int espeak_Initialize(espeak_AUDIO_OUTPUT output, int buflength, const char *pat path: The directory which contains the espeak-data directory, or NULL for the default location. - options: bit 0: 1=allow espeakEVENT_PHONEME events. - + options: bit 0: 1=allow espeakEVENT_PHONEME events. + bit 15: 1=don't exit if espeak_data is not found (used for --help) Returns: sample rate in Hz, or -1 (EE_INTERNAL_ERROR). */ @@ -180,7 +188,7 @@ typedef int (t_espeak_callback)(short*, int, espeak_EVENT*); #ifdef __cplusplus extern "C" #endif -void espeak_SetSynthCallback(t_espeak_callback* SynthCallback); +ESPEAK_API void espeak_SetSynthCallback(t_espeak_callback* SynthCallback); /* Must be called before any synthesis functions are called. This specifies a function in the calling program which is called when a buffer of speech sound data has been produced. @@ -208,7 +216,7 @@ int SynthCallback(short *wav, int numsamples, espeak_EVENT *events); #ifdef __cplusplus extern "C" #endif -void espeak_SetUriCallback(int (*UriCallback)(int, const char*, const char*)); +ESPEAK_API void espeak_SetUriCallback(int (*UriCallback)(int, const char*, const char*)); /* This function may be called before synthesis functions are used, in order to deal with