From 718b955bfc36e322df741d05ef67d26d70f5e517 Mon Sep 17 00:00:00 2001 From: jonsd Date: Tue, 23 Dec 2008 10:45:33 +0000 Subject: [PATCH] [1.40.01] Fix mbrola translation for "r" in Spanish and some other languages. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@214 d46cf337-b52f-0410-862d-fd96e6ae7743 --- docs/add_language.html | 19 +-- docs/commands.html | 18 ++- docs/dictionary.html | 10 +- docs/index.html | 6 +- docs/languages.html | 49 ++++--- docs/ssml.html | 16 +-- espeak-data/voices/{zhy => zh-yue} | 2 + phsource/mbrola/cr1 | 1 + phsource/mbrola/es | 1 + phsource/mbrola/hu1 | 1 + phsource/mbrola/id1 | 2 + phsource/mbrola/pl1 | 1 + platforms/riscos/copysource | 1 - platforms/windows/espeakedit/espeakedit.dsp | 18 +-- platforms/windows/espeakedit/src/speech.h | 125 ++++++++--------- .../windows/espeakedit/src_copy/speech.h | 125 ++++++++--------- platforms/windows/make_espeak.iss | 109 ++++++++++++--- platforms/windows/make_espeakedit.iss | 6 +- platforms/windows/windows_cmd/espeak.dsp | 16 +-- platforms/windows/windows_cmd/src/speech.h | 2 +- platforms/windows/windows_sapi/src/speech.h | 130 +++++++++--------- platforms/windows/windows_sapi/ttseng.dsp | 16 +-- platforms/windows/windows_sapi/ttsengobj.cpp | 65 +++++++++ platforms/windows/windows_sapi/version.rc2 | 10 +- src/extras.cpp | 2 +- src/formantdlg.cpp | 2 + src/spectseq.cpp | 5 +- src/speech.h | 2 +- src/synthdata.cpp | 2 +- src/transldlg.cpp | 2 + 30 files changed, 473 insertions(+), 291 deletions(-) rename espeak-data/voices/{zhy => zh-yue} (86%) diff --git a/docs/add_language.html b/docs/add_language.html index 7b400844..8bce53f4 100644 --- a/docs/add_language.html +++ b/docs/add_language.html @@ -22,15 +22,14 @@ syllables within words. Some languages are easier than others. I expect most are

  • Improve the sounds of the phonemes. It may be that a phoneme should sound different depending on adjacent sounds, or whether it's at the start or the end of a word, between vowels, etc. This may consist of making small adjustments to vowel and diphthong quality, or adjusting the strength of consonants. Bigger changes may be recording new or replacement consonant sounds, or even writing program code to implement new types of sounds. -

  • Marking some common words in the dictionary that should be unstressed (words such as "the", "is"), or should be preceded -by a short pause (such as "and", "but"), or have other attributes, in order to make the speech flow better. +

  • Some common words should be added to the dictionary (the *_list file for the language) with an "unstressed" attribute (eg. in English, words such as "the", "is", "had", "my", "she", "of", "in", "some"), or should be preceded +by a short pause (such as "and", "but", "which"), or have other attributes, in order to make the speech flow better.

  • Improve the rhythm of the speech by adjusting the relative lengths of vowels in different contexts, eg. stressed/unstressed syllable, or depending on the following phonemes. This is important for making the speech sound good for the language.

  • Identify or implement new functions in the program to improve the speech, or to deal with characteristics of the language which are not currently implemented. For example, a different intonation module. -If you are interested in working on a language, please contact me to set up the initial data and to -discuss the features of the language. +If you are interested in working on a language, please contact me so that I can set up the initial data and discuss the features of the language.

    For most of the eSpeak voices, I do not speak or understand the language, and I do not know how it should sound. I can only make improvements as a result of feedback from speakers of that language. If you want to help to improve a language, listen carefully and try to identify individual errors, either in the spelling-to-phoneme translation, the position of stressed syllables within words, or the sound of phonemes, or problems with rhythm and vowel lengths.


    @@ -90,11 +89,11 @@ marked as "unstressed" in order to make the speech flow better. These words generally include articles (eg: a, the, this, that), auxillary verbs (eg: is, have, will, can, may), pronouns and possessive adjectives (eg: he, his), some common prepositions (eg: -of, to, in, of), some common conjunctions (eg. and, or, if)., some +of, to, in, of), some common conjunctions (eg. and, or, if), some common adverbs and adjectives (eg. any, already)

    $pause Some words should be marked to have a short pause before then, in order to produce natural pauses in long sentences. -These include conjunctions (eg. and, or, but, however) and perhaps +These include conjunctions (eg. and, or, but, however, which) and perhaps some prepositions.


    6.4 Voice File

    @@ -122,12 +121,8 @@ language code and the required options in SetTranslator(). However, this may not be necessary during testing because most of the options can also be set from the voice file in espeak-data/voices.

    -

    If necessary, you can define a new -translator class for a language, and select this in the -SetTranslator() function. This inherits the standard functions -from the base translator class, but allows you to replace these where -needed by new functions which are written specially for this -language.

    + + \ No newline at end of file diff --git a/docs/commands.html b/docs/commands.html index 8e3ee35c..3e2f27fd 100644 --- a/docs/commands.html +++ b/docs/commands.html @@ -99,6 +99,10 @@ of 190. Range 80 to 390.
    Word gap. This option inserts a pause between words. The value is the length of the pause, in units of 10 mS (at the default speed of 170 wpm).

    +-h or --help
    +
    The first line of output gives the eSpeak version number. +

    +

    -k <integer>
    Indicate words which begin with capital letters.

    1   eSpeak uses a click sound to indicate when a word starts with a capital letter, or double click if word is all capitals.

    @@ -164,6 +168,14 @@ Compile the pronunciation rule and dictionary lookup data from their source file

    The same as --compile, but source line numbers from the *_rules file are included. These are included in the rules trace when the -X option is used.

    +

    --path [="<directory path>"]
    +
    +Specifies the directory which contains the espeak-data directory. +

    +

    --phonout [="<filename>"]
    +
    +If specified, mbrola phoneme data, and also the output from -x and -X options is written to this file, rather than stdout. +

    --punct [="<characters>"]
    Speaks the names of punctuation characters when they are encountered in the text. If <characters> are given, then only those listed punctuation characters are spoken, eg. --punct=".,;?" @@ -190,8 +202,10 @@ If the -m option is used to indicate marked-up text, then HTML can be spoken dir
    Phoneme Input
    As well as plain text, phoneme mnemonics can be used in the text input to espeak. They are enclosed within double square brackets. Spaces are used to separate words and all stressed syllables must be marked explicitly.

    -   eg:   espeak -v en [[D,Is Iz sVm f@n'EtIk t'Ekst 'InpUt]]

    - ("This is some phonetic text input"). +   eg:   espeak -v en "[[D,Is Iz sVm f@n'EtIk t'Ekst 'InpUt]]"

    + This command will speak: "This is some phonetic text input". + + diff --git a/docs/dictionary.html b/docs/dictionary.html index 22034028..a7fc0957 100644 --- a/docs/dictionary.html +++ b/docs/dictionary.html @@ -73,7 +73,7 @@ The utility 'phonemes' are: It is not necessary to specify the stress of every syllable. Stress markers are only needed in order to change the effect of the language's default stress rule.

    -The phonemes which are used to represent a language's sounds are based on the Kirshenbaum ascii character representation of the International Phonetic Alphabet www.kirshenbaum.net/IPA/ascii-ipa.pdf +The phonemes which are used to represent a language's sounds are based loosely on the Kirshenbaum ascii character representation of the International Phonetic Alphabet www.kirshenbaum.net/IPA/ascii-ipa.pdf

     


    4.3 Pronunciation Rules

    @@ -94,7 +94,7 @@ The rules are organized in groups, each starting with a ".group" line: A group for other characters which don't have their own group.

    .L<nn>
    - Defines a group of letter sequences, any of which can match with Lnn in a post rule (see below). nn is a 2 digit decimal number in the range 01 to 20. eg:

    + Defines a group of letter sequences, any of which can match with Lnn in a post rule (see below). nn is a 2 digit decimal number in the range 01 to 25. eg:

    .L01 b bl br pl pr

    .replace
    @@ -249,7 +249,7 @@ Note, that matching characters in the <pre> part do not affect the syllabl T - Only use this rule if the word in found in the *_list file with the $alt1 attribute. + Only use this rule if the word in found in the *_list file with the $alt attribute. # @@ -352,6 +352,7 @@ or to run them together, pronounced as a single word or to give them a flag when they occur together
        (such as)    sVtS||a2z   $pause	   // precede with a pause
     
    +Hyphenated words in the <language>_list  file must also be enclosed within brackets, because the two parts are considered as separate words.

    4.4.2 Special characters in <phoneme string>:

      @@ -600,7 +601,7 @@ _0 to _9   - + @@ -619,5 +620,6 @@ Character substitutions can be specified by using a .replace section at

      + diff --git a/docs/index.html b/docs/index.html index eca3b873..9696493d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -18,7 +18,7 @@ (email)   jonsd at users dot sourceforge.net
      Download         Forum -         eSpeak Sourceforge page +         eSpeak Sourceforge page @@ -48,7 +48,7 @@ It can run as a command line program to speak text from a file or from stdin. A

    • Includes different Voices, whose characteristics can be altered.
    • Can produce speech output as a WAV file.
    • SSML (Speech Synthesis Markup Language) is supported (not complete), and also HTML. -
    • Compact size. The program and its data, including several languages, totals about 700 kbytes. +
    • Compact size. The program and its data, including many languages, totals about 1 Mbytes.
    • Can translate text to phoneme codes, so it could be adapted as a front end for another speech synthesis engine.
    • Potential for other languages. Several are included in varying stages of progress. Help from native speakers for these or other languages is welcomed.
    • Development tools available for producing and tuning phoneme data. @@ -65,7 +65,7 @@ A Windows version of the espeakedit program is also available.
      Languages. The eSpeak speech synthesizer supports several languages, however in most cases these are initial drafts and need more work to improve them. Assistance from native speakers is welcome for these, or other new languages. Please contact me if you want to help.

      -eSpeak does text to speech synthesis for the following languages, some better than others. Afrikaans, Cantonese, Croatian, Czech, Dutch, English, Esperanto, Finnish, French, German, Greek, Hindi, Hungarian, Icelandic, Italian, Lojban, Macedonian, Mandarin, Norwegian, Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Spanish, Swahili, Swedish, Vietnamese, Welsh. See Languages. +eSpeak does text to speech synthesis for the following languages, some better than others. Afrikaans, Albanian, Armenian, Cantonese, Catalan, Croatian, Czech, Dutch, English, Esperanto, Finnish, French, German, Greek, Hindi, Hungarian, Icelandic, Indonesian, Italian, Kurdish, Latvian, Lojban, Macedonian, Mandarin, Norwegian, Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Spanish, Swahili, Swedish, Tamil, Vietnamese, Welsh. See Languages.


      espeakedit is a GUI program used to prepare and compile phoneme data. It is now available for download. Documentation is currently sparse, but if you want to use it to add or improve language support, let me know.
      diff --git a/docs/languages.html b/docs/languages.html index 00267706..45025fe5 100644 --- a/docs/languages.html +++ b/docs/languages.html @@ -46,12 +46,12 @@ For details of the voice files see Voices.
      is the standard default English voice.

      -en-sc
      -
      Scottish English. +en-us
      +
      American English.

      -en-r
      -
      Some slight vowel changes, and a "rhotic" accent, where "r" is pronounced even when not followed by a vowel. This may sound less "British" to an American. +en-sc
      +
      Scottish English.

      en-n
      @@ -73,7 +73,7 @@ The variants are +m1 +m2 +m3 +m4 +m5 for male voices, The available voice variants can be listed with:
         espeak --voices=variant

      3.4 Other Languages

      -The eSpeak speech synthesizer does text to speech for the following additional languages. +The eSpeak speech synthesizer does text to speech for the following additional langauges.

        @@ -87,6 +87,10 @@ The eSpeak speech synthesizer does text to speech for the following additional l

        +ca  Catalan
        +
        +

        +

        cs  Czech
        Usable.
        @@ -102,11 +106,7 @@ The eSpeak speech synthesizer does text to speech for the following additional l

        eo  Esperanto
        -
        Esperanto has simple and regular pronunciation rules, so it should be OK, although I'm not - certain how it's supposed to sound, other than what I've read in an introduction. - Text can be either UTF-8, or Latin3 alphabet, or - can use the Latin1 convention of two-letter combinations (cx, - gx, etc).
        +
        Esperanto has simple and regular pronunciation rules, so it should be OK.

        es  Spanish
        @@ -149,6 +149,17 @@ Not much work yet, but Kurdish has good spelling rules so it should be OK.

        +lv  Latvian
        +
        This has had assistance from a native speaker and it should be OK. +
        +

        +

        +pl  Polish
        +
        +Usable. +
        +

        +

        pt  Portuguese (Brazil)
        Brazilian Portuguese. This has had assistance from a native speaker and it should be OK. Like Italian there is further work to do about the ambiguity in the spelling between open/close "e" and "o" vowels.

        @@ -224,6 +235,11 @@ These languages are only initial naive implementations which have had little or

        +hy  Armenian
        +
        Needs feedback from native speakers. The hy-west voice has different pronunciation of some consonants for Western Armenian pronunciation. +
        +

        +

        id  Indonesian
        An initial guess, no feedback yet.
        @@ -250,7 +266,7 @@ These languages are only initial naive implementations which have had little or

        nl  Dutch
        -
        Probably needs improvement of the spelling-to-phoneme rules. +
        Needs improvement of the spelling-to-phoneme rules.

        @@ -259,23 +275,22 @@ These languages are only initial naive implementations which have had little or

        -pl  Polish
        -
        Some initial feedback, but I'm told it's difficult to understand, so more work is needed. -
        -

        -

        ru  Russian
        So far it's just an initial attempt with basic pronunciation rules. Work is needed especially on the consonants. Russian has two versions of most consonants, "hard" and "soft" (palatalised) and in most cases eSpeak doesn't yet make a proper distinction.
        Russian stress position is unpredictable so a large lookup dictionary is needed of those words where eSpeak doesn't guess correctly. To avoid increasing the size of the basic eSpeak package, this is available separately at: http://espeak.sourceforge.net/data/

        +sq  Albanian
        +
        Some initial feedback, but needs more work.
        +

        +

        vi  Vietnamese
        This is interesting because it's a tone language. I don't know how it should sound, so it's just a guess and I need feedback.

        -zhy  Cantonese Chinese
        +zh-yue  Cantonese Chinese
        Just a naive simple one-to-one translation from single Simplified Chinese characters to phonetic equivalents in Cantonese. There is limited attempt at disambiguation, grouping characters into words, or adjusting tones according to their surrounding syllables. This voice needs Chinese character to phonetic translation data, which is available as a separate download for Cantonese at: http://espeak.sourceforge.net/data/.
        The voice can also read Jyutping romanised text.
      diff --git a/docs/ssml.html b/docs/ssml.html index c8017599..8ecdfba9 100644 --- a/docs/ssml.html +++ b/docs/ssml.html @@ -3,6 +3,7 @@ eSpeak + @@ -35,16 +36,11 @@ The following markup tags and attributes are recognised:

      <say-as>

        -
      • interpret-as="characters"

        -The names of the characters are spoken. -

      • interpret-as="characters"  format="glyphs"

        -As "characters", but upper-case letters are prefixed with "Capital". -

      • interpret-as="tts:key"

        -If the text is only one character, the name of the character is spoken, including punctuation characters. If the text is more than one character, it is spoken as words. -

      • interpret-as="tts:char"

        -The name of the character is spoken, including punctuation characters. -

      • interpret-as="tts:digits"

        -The digits are spoken individually. +

      • interpret-as="characters" +
      • interpret-as="characters"  format="glyphs" +
      • interpret-as="tts:key" +
      • interpret-as="tts:char" +
      • interpret-as="tts:digits"

      <mark> name

      <s> diff --git a/espeak-data/voices/zhy b/espeak-data/voices/zh-yue similarity index 86% rename from espeak-data/voices/zhy rename to espeak-data/voices/zh-yue index 4f77dcb5..ba872326 100755 --- a/espeak-data/voices/zhy +++ b/espeak-data/voices/zh-yue @@ -1,7 +1,9 @@ name cantonese-test language zh-yue language yue +language zhy +translator zhy phonemes zhy dictionary zhy gender male diff --git a/phsource/mbrola/cr1 b/phsource/mbrola/cr1 index 6fbe5bb0..cd86df41 100644 --- a/phsource/mbrola/cr1 +++ b/phsource/mbrola/cr1 @@ -17,6 +17,7 @@ volume 16 0 @- NULL 0 NULL 0 * NULL 0 r 0 r* NULL 0 NULL +0 R2 NULL 0 r 0 I NULL 0 i 0 U NULL 0 u diff --git a/phsource/mbrola/es b/phsource/mbrola/es index 1595840b..86bc8a0c 100644 --- a/phsource/mbrola/es +++ b/phsource/mbrola/es @@ -14,6 +14,7 @@ 0 ** NULL 0 r 0 R NULL 0 rr +0 R2 NULL 0 NULL 0 v# NULL 0 b 0 v NULL 0 b 0 j NULL 0 i diff --git a/phsource/mbrola/hu1 b/phsource/mbrola/hu1 index 531de819..aff2cb49 100644 --- a/phsource/mbrola/hu1 +++ b/phsource/mbrola/hu1 @@ -13,6 +13,7 @@ volume 32 0 g- NULL 0 NULL 0 @- NULL 0 NULL 0 * NULL 0 r +0 R2 NULL 0 r 0 e NULL 0 e: 0 A NULL 0 O diff --git a/phsource/mbrola/id1 b/phsource/mbrola/id1 index f51fff4a..784cc440 100644 --- a/phsource/mbrola/id1 +++ b/phsource/mbrola/id1 @@ -23,6 +23,8 @@ volume 32 0 g- NULL 0 NULL 0 @- NULL 0 NULL 0 * NULL 0 r +0 R2 NULL 0 r +0 R NULL 0 r 0 a NULL 0 V 0 E NULL 0 e diff --git a/phsource/mbrola/pl1 b/phsource/mbrola/pl1 index bb2545e5..3163ca71 100644 --- a/phsource/mbrola/pl1 +++ b/phsource/mbrola/pl1 @@ -15,6 +15,7 @@ 0 @- NULL 0 NULL 0 * NULL 0 r +0 a# NULL 0 a 0 y NULL 0 I 0 E NULL 0 e 0 O NULL 0 o diff --git a/platforms/riscos/copysource b/platforms/riscos/copysource index 13698cce..4bfece70 100644 --- a/platforms/riscos/copysource +++ b/platforms/riscos/copysource @@ -9,7 +9,6 @@ copy .^.src.synthdata/cpp .cpp.synthdata fq~c copy .^.src.synth_mbrola/cpp .cpp.synth_mbrola fq~c copy .^.src.synthesize/cpp .cpp.synthesize fq~c copy .^.src.translate/cpp .cpp.translate fq~c -copy .^.src.tr_english/cpp .cpp.tr_english fq~c copy .^.src.tr_languages/cpp .cpp.tr_languages fq~c copy .^.src.voices/cpp .cpp.voices fq~c copy .^.src.wavegen/cpp .cpp.wavegen fq~c diff --git a/platforms/windows/espeakedit/espeakedit.dsp b/platforms/windows/espeakedit/espeakedit.dsp index 5caa8d6a..a28ff5c5 100755 --- a/platforms/windows/espeakedit/espeakedit.dsp +++ b/platforms/windows/espeakedit/espeakedit.dsp @@ -357,7 +357,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W4 /GR /O2 /I ".\..\..\lib\vc_lib\mswu" /I ".\..\..\include" /I "." /I ".\..\..\samples" /D "WIN32" /D "__WXMSW__" /D "_UNICODE" /D "_WINDOWS" /D "NOPCH" /Fd"vc_mswu\minimal.pdb" /FD /EHsc /c -# ADD CPP /nologo /MD /W4 /GR /O2 /I ".\..\..\lib\vc_lib\mswu" /I ".\..\..\include" /I "." /I ".\..\..\samples" /D "WIN32" /D "__WXMSW__" /D "_UNICODE" /D "_WINDOWS" /D "NOPCH" /Fd"vc_mswu\minimal.pdb" /FD /EHsc /c +# ADD CPP /nologo /MD /W3 /GR /O2 /I ".\..\..\lib\vc_lib\mswu" /I ".\..\..\include" /I "." /I ".\..\..\samples" /D "WIN32" /D "__WXMSW__" /D "_UNICODE" /D "_WINDOWS" /D "NOPCH" /Fd"vc_mswu\minimal.pdb" /FD /EHsc /c # ADD BASE MTL /nologo /D "WIN32" /D "__WXMSW__" /D "_UNICODE" /D "_WINDOWS" /D "NOPCH" /mktyplib203 /win32 # ADD MTL /nologo /D "WIN32" /D "__WXMSW__" /D "_UNICODE" /D "_WINDOWS" /D "NOPCH" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /i ".\..\..\lib\vc_lib\mswu" /i ".\..\..\include" /i "." /i ".\..\..\samples" /d "__WXMSW__" /d "_UNICODE" /d "_WINDOWS" /d "NOPCH" @@ -541,6 +541,14 @@ SOURCE=.\src\intonation.cpp # End Source File # Begin Source File +SOURCE=.\src\klatt.cpp +# End Source File +# Begin Source File + +SOURCE=.\src\klatt.h +# End Source File +# Begin Source File + SOURCE=.\src\main.h # End Source File # Begin Source File @@ -653,18 +661,10 @@ SOURCE=.\src\synthesize.h # End Source File # Begin Source File -SOURCE=.\src\tr_english.cpp -# End Source File -# Begin Source File - SOURCE=.\src\tr_languages.cpp # End Source File # Begin Source File -SOURCE=.\src\tr_languages.h -# End Source File -# Begin Source File - SOURCE=.\src\translate.cpp # End Source File # Begin Source File diff --git a/platforms/windows/espeakedit/src/speech.h b/platforms/windows/espeakedit/src/speech.h index 8b81cfe0..fc900bb0 100755 --- a/platforms/windows/espeakedit/src/speech.h +++ b/platforms/windows/espeakedit/src/speech.h @@ -1,62 +1,63 @@ -/*************************************************************************** - * Copyright (C) 2005,2006 by Jonathan Duddington * - * jsd@clara.co.uk * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - - -#define LOG_FRAMES // write keyframe info to src/log - - -// comment this out when compiling the "speak" process -//#define SPECT_EDITOR - -#include -#define PLATFORM_WINDOWS -#define __WIN32__ -#define mkdir(p1,p2) mkdir(p1) - -#define PATHSEP '\\' -#define USE_PORTAUDIO -//#define USE_NANOSLEEP -#define __cdecl -#define ESPEAK_API -#define PATH_ESPEAK_DATA "C:\\Program files\\espeak\\espeak-data" - -typedef unsigned short USHORT; -typedef unsigned char UCHAR; -typedef double DOUBLEX; - - - - -typedef struct { - const char *mnem; - int value; -} MNEM_TAB; -int LookupMnem(MNEM_TAB *table, char *string); - - - -#define N_PATH_HOME 120 -extern char path_home[N_PATH_HOME]; // this is the espeak-data directory - -extern void strncpy0(char *to,const char *from, int size); -int GetFileLength(const char *filename); -char *Alloc(int size); -void Free(void *ptr); - +/*************************************************************************** + * Copyright (C) 2005,2006 by Jonathan Duddington * + * jsd@clara.co.uk * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + +#define LOG_FRAMES // write keyframe info to src/log + + +// comment this out when compiling the "speak" process +//#define SPECT_EDITOR +#define INCLUDE_KLATT + +#include +#define PLATFORM_WINDOWS +#define __WIN32__ +#define mkdir(p1,p2) mkdir(p1) + +#define PATHSEP '\\' +#define USE_PORTAUDIO +//#define USE_NANOSLEEP +#define __cdecl +#define ESPEAK_API +#define PATH_ESPEAK_DATA "C:\\Program files\\espeak\\espeak-data" + +typedef unsigned short USHORT; +typedef unsigned char UCHAR; +typedef double DOUBLEX; + + + + +typedef struct { + const char *mnem; + int value; +} MNEM_TAB; +int LookupMnem(MNEM_TAB *table, char *string); + + + +#define N_PATH_HOME 120 +extern char path_home[N_PATH_HOME]; // this is the espeak-data directory + +extern void strncpy0(char *to,const char *from, int size); +int GetFileLength(const char *filename); +char *Alloc(int size); +void Free(void *ptr); + diff --git a/platforms/windows/espeakedit/src_copy/speech.h b/platforms/windows/espeakedit/src_copy/speech.h index 8b81cfe0..fc900bb0 100755 --- a/platforms/windows/espeakedit/src_copy/speech.h +++ b/platforms/windows/espeakedit/src_copy/speech.h @@ -1,62 +1,63 @@ -/*************************************************************************** - * Copyright (C) 2005,2006 by Jonathan Duddington * - * jsd@clara.co.uk * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - - -#define LOG_FRAMES // write keyframe info to src/log - - -// comment this out when compiling the "speak" process -//#define SPECT_EDITOR - -#include -#define PLATFORM_WINDOWS -#define __WIN32__ -#define mkdir(p1,p2) mkdir(p1) - -#define PATHSEP '\\' -#define USE_PORTAUDIO -//#define USE_NANOSLEEP -#define __cdecl -#define ESPEAK_API -#define PATH_ESPEAK_DATA "C:\\Program files\\espeak\\espeak-data" - -typedef unsigned short USHORT; -typedef unsigned char UCHAR; -typedef double DOUBLEX; - - - - -typedef struct { - const char *mnem; - int value; -} MNEM_TAB; -int LookupMnem(MNEM_TAB *table, char *string); - - - -#define N_PATH_HOME 120 -extern char path_home[N_PATH_HOME]; // this is the espeak-data directory - -extern void strncpy0(char *to,const char *from, int size); -int GetFileLength(const char *filename); -char *Alloc(int size); -void Free(void *ptr); - +/*************************************************************************** + * Copyright (C) 2005,2006 by Jonathan Duddington * + * jsd@clara.co.uk * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + +#define LOG_FRAMES // write keyframe info to src/log + + +// comment this out when compiling the "speak" process +//#define SPECT_EDITOR +#define INCLUDE_KLATT + +#include +#define PLATFORM_WINDOWS +#define __WIN32__ +#define mkdir(p1,p2) mkdir(p1) + +#define PATHSEP '\\' +#define USE_PORTAUDIO +//#define USE_NANOSLEEP +#define __cdecl +#define ESPEAK_API +#define PATH_ESPEAK_DATA "C:\\Program files\\espeak\\espeak-data" + +typedef unsigned short USHORT; +typedef unsigned char UCHAR; +typedef double DOUBLEX; + + + + +typedef struct { + const char *mnem; + int value; +} MNEM_TAB; +int LookupMnem(MNEM_TAB *table, char *string); + + + +#define N_PATH_HOME 120 +extern char path_home[N_PATH_HOME]; // this is the espeak-data directory + +extern void strncpy0(char *to,const char *from, int size); +int GetFileLength(const char *filename); +char *Alloc(int size); +void Free(void *ptr); + diff --git a/platforms/windows/make_espeak.iss b/platforms/windows/make_espeak.iss index 40f26339..1374c291 100755 --- a/platforms/windows/make_espeak.iss +++ b/platforms/windows/make_espeak.iss @@ -2,7 +2,7 @@ [Setup] AppName=eSpeak -AppVerName=eSpeak version 1.38 +AppVerName=eSpeak version 1.40 AppCopyright=Licensed under GNU General Public License version 3. (See file License.txt for details). WindowVisible=yes @@ -15,6 +15,7 @@ ShowLanguageDialog=auto [InstallDelete] Type: files; Name: "{app}\espeak.dll" +Type: filesandordirs; Name: "{app}\espeak-data\voices\test" [Dirs] Name: "{app}\espeak-data\soundicons" @@ -31,12 +32,7 @@ Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme Source: "License.txt"; DestDir: "{app}"; [Registry] -Root: HKLM; Subkey: "Software\Microsoft\Speech\Voices\Tokens\eSpeak"; Flags: deletekey uninsdeletekey -Root: HKLM; Subkey: "Software\Microsoft\Speech\Voices\Tokens\eSpeak_1"; Flags: deletekey uninsdeletekey -Root: HKLM; Subkey: "Software\Microsoft\Speech\Voices\Tokens\eSpeak_2"; Flags: deletekey uninsdeletekey -Root: HKLM; Subkey: "Software\Microsoft\Speech\Voices\Tokens\eSpeak_3"; Flags: deletekey uninsdeletekey -Root: HKLM; Subkey: "Software\Microsoft\Speech\Voices\Tokens\eSpeak_4"; Flags: deletekey uninsdeletekey -Root: HKLM; Subkey: "Software\Microsoft\Speech\Voices\Tokens\eSpeak_5"; Flags: deletekey uninsdeletekey +;Root: HKLM; Subkey: "Software\Microsoft\Speech\Voices\Tokens\eSpeak_5"; Flags: deletekey uninsdeletekey Root: HKLM; Subkey: "Software\Microsoft\Speech\PhoneConverters\Tokens\eSpeak"; Flags: deletekey uninsdeletekey @@ -52,7 +48,9 @@ Name: "fi"; MessagesFile: "compiler:Languages\Finnish.isl" Name: "fr"; MessagesFile: "compiler:Languages\French.isl" Name: "hr"; MessagesFile: "compiler:Languages\Croatian.isl" Name: "hu"; MessagesFile: "compiler:Languages\Hungarian.isl" +Name: "id"; MessagesFile: "compiler:Languages\Indonesian-5.1.11.isl" Name: "it"; MessagesFile: "compiler:Languages\Italian.isl" +Name: "lv"; MessagesFile: "compiler:Languages\Latvian-1-5.1.11.isl" Name: "nl"; MessagesFile: "compiler:Languages\Dutch.isl" Name: "no"; MessagesFile: "compiler:Languages\Norwegian.isl" Name: "pl"; MessagesFile: "compiler:Languages\Polish.isl" @@ -60,8 +58,10 @@ Name: "pt"; MessagesFile: "compiler:Languages\Portuguese.isl" Name: "ro"; MessagesFile: "compiler:Languages\Romanian.isl" Name: "ru"; MessagesFile: "compiler:Languages\Russian.isl" Name: "sk"; MessagesFile: "compiler:Languages\Slovak.isl" +Name: "sq"; MessagesFile: "compiler:Languages\Albanian-2-5.1.11.isl" Name: "sr"; MessagesFile: "compiler:Languages\Serbian.isl" Name: "tr"; MessagesFile: "compiler:Languages\Turkish.isl" +Name: "zh"; MessagesFile: "compiler:Languages\ChineseSimp-12-5.1.11.isl" [CustomMessages] v1=Select which voices to install @@ -111,6 +111,7 @@ begin // translation from microsoft codes to language codes case lang_main of + $03: Result := 'ca'; $04: Result := 'zh'; $05: Result := 'cs'; $06: Result := 'da'; @@ -132,16 +133,21 @@ begin $19: Result := 'ru'; $1a: Result := 'hr'; $1b: Result := 'sk'; + $1c: Result := 'sq'; $1d: Result := 'sv'; $1f: Result := 'tr'; $21: Result := 'id'; + $26: Result := 'lv'; $2a: Result := 'vi'; + $2b: Result := 'hy'; $2f: Result := 'mk'; $36: Result := 'af'; $39: Result := 'hi'; $41: Result := 'sw'; $49: Result := 'ta'; + $4b: Result := 'kn'; $52: Result := 'cy'; + $61: Result := 'ne'; $87: Result := 'rw'; end; @@ -178,6 +184,7 @@ begin case lang1 of 'af': value := $436; 'bs': value := $41a; // should be $141a but Jaws crashes on startup + 'ca': value := $403; 'cs': value := $405; 'cy': value := $452; 'da': value := $406; @@ -190,11 +197,15 @@ begin 'hi': value := $439; 'hr': value := $41a; 'hu': value := $40e; + 'hy': value := $42b; 'id': value := $421; 'is': value := $40f; 'it': value := $410; + 'kn': value := $44b; 'ko': value := $412; + 'lv': value := $426; 'mk': value := $42f; + 'ne': value := $461; 'nl': value := $413; 'no': value := $414; 'pl': value := $415; @@ -203,6 +214,7 @@ begin 'ru': value := $419; 'rw': value := $487; 'sk': value := $41b; + 'sq': value := $41c; 'sr': value := $81a; 'sv': value := $41d; 'sw': value := $441; @@ -311,13 +323,16 @@ begin end; -procedure SetupVoice(Voice, Lcode: String; Index: Integer); +procedure SetupVoice(Voice: String; Index: Integer); var RegVoice2: String; RegVoice2a: String; VoiceUC: String; + Lcode: String; begin + Lcode := LanguageFromVoice(Voice); + if Index = 0 then RegVoice2 := RegVoice1 else @@ -339,7 +354,7 @@ begin RegWriteStringValue(HKEY_LOCAL_MACHINE,RegVoice2a,'Gender','Male'); RegWriteStringValue(HKEY_LOCAL_MACHINE,RegVoice2a,'Age','Adult'); RegWriteStringValue(HKEY_LOCAL_MACHINE,RegVoice2a,'Language',Lcode); - RegWriteStringValue(HKEY_LOCAL_MACHINE,RegVoice2a,'Vendor','Jonathan Duddington'); + RegWriteStringValue(HKEY_LOCAL_MACHINE,RegVoice2a,'Vendor','http://espeak.sf.net'); SetPhoneConvertor(Lcode); end; @@ -348,14 +363,38 @@ end; procedure CurStepChanged(CurStep: TSetupStep); var + field: Integer; + Index: Integer; ix: Integer; + ix2: Integer; + Line: String; + Voice: String; + Voice2: String; + separator: String; begin if CurStep = ssPostInstall then begin + separator := ' '; + Index := 0; + for field := 0 to 4 do begin + Line := Page.Values[field]; + ix := 1; + ix2 := 1; + while ix2 > 0 do begin + ix2 := Pos(separator,Copy(Line,ix,999)); - for ix := 0 to 5 do begin - if Page.Values[ix] <> '' then - SetUpVoice(Page.Values[ix],LanguageFromVoice(Page.Values[ix]),ix); + if ix2 = 0 then + Voice := Copy(Line,ix,999) + else + Voice := Copy(Line,ix,ix2-1); + + Voice2 := Trim(Voice); + if Voice2 <> '' then begin + SetUpVoice(Trim(Voice),Index); + Index := Index + 1; + end; + ix := ix + ix2; + end; end; end; end; @@ -364,6 +403,7 @@ end; procedure InitializeWizard; var lang: String; + voice2: String; begin // Create the language selection page lang := ActiveLanguage; @@ -375,20 +415,55 @@ begin Page.Add('', False); Page.Add('', False); Page.Add('', False); - Page.Add('', False); UILanguage := GetUILanguage; UIVoice := VoiceFromLanguage(UILanguage); // Set initial values (optional) - Page.Values[0] := UIVoice; - Page.Values[1] := UIVoice+'+f2'; if UIVoice = 'en' then - Page.Values[2] := 'en-r' + voice2 := 'en-us' else - Page.values[2] := 'en'; + voice2 := 'en'; + Page.Values[0] := Format('%s %s %s',[UIVoice, UIVoice+'+f2', voice2]); end; +procedure ClearRegistry; +var + Index: Integer; + RegVoice2: String; + exists: Boolean; +begin +// remove all espeak voices from the registry + exists := True; + Index := 0; + while exists do begin + if Index = 0 then + RegVoice2 := RegVoice1 + else + RegVoice2 := RegVoice1 + Format('_%d',[Index]); + + exists := RegKeyExists(HKEY_LOCAL_MACHINE,RegVoice2); + RegDeleteKeyIncludingSubkeys(HKEY_LOCAL_MACHINE,RegVoice2); + Index := Index + 1; + end; +end; + +function InitializeSetup: Boolean; +begin +// remove all espeak voices from the registry + ClearRegistry; + result := True; +end; + +function InitializeUninstall: Boolean; +begin +// remove all espeak voices from the registry + ClearRegistry; + result := True; +end; + + + diff --git a/platforms/windows/make_espeakedit.iss b/platforms/windows/make_espeakedit.iss index 6348f2f7..e6569a94 100755 --- a/platforms/windows/make_espeakedit.iss +++ b/platforms/windows/make_espeakedit.iss @@ -1,7 +1,7 @@ [Setup] AppName=eSpeakEdit -AppVerName=eSpeakEdit version 1.38 +AppVerName=eSpeakEdit version 1.40 DefaultDirName={pf}\eSpeak DefaultGroupName=eSpeak OutputBaseFilename=setup_espeakedit @@ -32,7 +32,9 @@ Name: "fi"; MessagesFile: "compiler:Languages\Finnish.isl" Name: "fr"; MessagesFile: "compiler:Languages\French.isl" Name: "hr"; MessagesFile: "compiler:Languages\Croatian.isl" Name: "hu"; MessagesFile: "compiler:Languages\Hungarian.isl" +Name: "id"; MessagesFile: "compiler:Languages\Indonesian-5.1.11.isl" Name: "it"; MessagesFile: "compiler:Languages\Italian.isl" +Name: "lv"; MessagesFile: "compiler:Languages\Latvian-1-5.1.11.isl" Name: "nl"; MessagesFile: "compiler:Languages\Dutch.isl" Name: "no"; MessagesFile: "compiler:Languages\Norwegian.isl" Name: "pl"; MessagesFile: "compiler:Languages\Polish.isl" @@ -40,6 +42,8 @@ Name: "pt"; MessagesFile: "compiler:Languages\Portuguese.isl" Name: "ro"; MessagesFile: "compiler:Languages\Romanian.isl" Name: "ru"; MessagesFile: "compiler:Languages\Russian.isl" Name: "sk"; MessagesFile: "compiler:Languages\Slovak.isl" +Name: "sq"; MessagesFile: "compiler:Languages\Albanian-2-5.1.11.isl" Name: "sr"; MessagesFile: "compiler:Languages\Serbian.isl" Name: "tr"; MessagesFile: "compiler:Languages\Turkish.isl" +Name: "zh"; MessagesFile: "compiler:Languages\ChineseSimp-12-5.1.11.isl" diff --git a/platforms/windows/windows_cmd/espeak.dsp b/platforms/windows/windows_cmd/espeak.dsp index 99ff63ff..fd214376 100755 --- a/platforms/windows/windows_cmd/espeak.dsp +++ b/platforms/windows/windows_cmd/espeak.dsp @@ -98,6 +98,10 @@ SOURCE=.\src\intonation.cpp # End Source File # Begin Source File +SOURCE=.\src\klatt.cpp +# End Source File +# Begin Source File + SOURCE=.\src\numbers.cpp # End Source File # Begin Source File @@ -135,10 +139,6 @@ SOURCE=.\src\synthesize.cpp # End Source File # Begin Source File -SOURCE=.\src\tr_english.cpp -# End Source File -# Begin Source File - SOURCE=.\src\tr_languages.cpp # End Source File # Begin Source File @@ -159,6 +159,10 @@ SOURCE=.\src\wavegen.cpp # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File +SOURCE=.\src\klatt.h +# End Source File +# Begin Source File + SOURCE=.\src\phoneme.h # End Source File # Begin Source File @@ -183,10 +187,6 @@ SOURCE=.\src\synthesize.h # End Source File # Begin Source File -SOURCE=.\src\tr_languages.h -# End Source File -# Begin Source File - SOURCE=.\src\translate.h # End Source File # Begin Source File diff --git a/platforms/windows/windows_cmd/src/speech.h b/platforms/windows/windows_cmd/src/speech.h index 8af6f3a1..2736b5ef 100755 --- a/platforms/windows/windows_cmd/src/speech.h +++ b/platforms/windows/windows_cmd/src/speech.h @@ -31,7 +31,7 @@ #define PATHSEP '\\' #define USE_PORTAUDIO #define ESPEAK_API -#define INCLUDE_KLATT +//#define INCLUDE_KLATT // will look for espeak_data directory here, and also in user's home directory #define PATH_ESPEAK_DATA "/usr/share/espeak-data" diff --git a/platforms/windows/windows_sapi/src/speech.h b/platforms/windows/windows_sapi/src/speech.h index 77386794..d65d5408 100755 --- a/platforms/windows/windows_sapi/src/speech.h +++ b/platforms/windows/windows_sapi/src/speech.h @@ -1,65 +1,65 @@ -/*************************************************************************** - * Copyright (C) 2005,2006 by Jonathan Duddington * - * jsd@clara.co.uk * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -// speech.h file for the Windows SAPI5 version of eSpeak - - -// conditional compilation options - -#define PLATFORM_WINDOWS -#define __WIN32__ -#define NEED_WCSTOF -#define NEED_GETOPT -#define USE_MBROLA_LIB -#define ESPEAK_API - -#define PATHSEP '\\' -//#define PLATFORM_POSIX -//#define __cdecl // define as null, needed for Borland compiler ? -//#define USE_PORTAUDIO -//#define USE_NANOSLEEP -#define INCLUDE_KLATT - -// will look for espeak_data directory here, and also in user's home directory -#define PATH_ESPEAK_DATA "/usr/share/espeak-data" - -typedef unsigned short USHORT; -typedef unsigned char UCHAR; -typedef double DOUBLEX; - - - - -typedef struct { - const char *mnem; - int value; -} MNEM_TAB; -int LookupMnem(MNEM_TAB *table, char *string); - - - -#define N_PATH_HOME 220 -extern char path_home[N_PATH_HOME]; // this is the espeak-data directory - -extern void strncpy0(char *to,const char *from, int size); -int GetFileLength(const char *filename); -char *Alloc(int size); -void Free(void *ptr); - +/*************************************************************************** + * Copyright (C) 2005,2006 by Jonathan Duddington * + * jsd@clara.co.uk * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +// speech.h file for the Windows SAPI5 version of eSpeak + + +// conditional compilation options + +#define PLATFORM_WINDOWS +#define __WIN32__ +#define NEED_WCSTOF +#define NEED_GETOPT +#define USE_MBROLA_LIB +#define ESPEAK_API + +#define PATHSEP '\\' +//#define PLATFORM_POSIX +//#define __cdecl // define as null, needed for Borland compiler ? +//#define USE_PORTAUDIO +//#define USE_NANOSLEEP +//#define INCLUDE_KLATT + +// will look for espeak_data directory here, and also in user's home directory +#define PATH_ESPEAK_DATA "/usr/share/espeak-data" + +typedef unsigned short USHORT; +typedef unsigned char UCHAR; +typedef double DOUBLEX; + + + + +typedef struct { + const char *mnem; + int value; +} MNEM_TAB; +int LookupMnem(MNEM_TAB *table, char *string); + + + +#define N_PATH_HOME 220 +extern char path_home[N_PATH_HOME]; // this is the espeak-data directory + +extern void strncpy0(char *to,const char *from, int size); +int GetFileLength(const char *filename); +char *Alloc(int size); +void Free(void *ptr); + diff --git a/platforms/windows/windows_sapi/ttseng.dsp b/platforms/windows/windows_sapi/ttseng.dsp index 27671d2a..cf5d15bc 100755 --- a/platforms/windows/windows_sapi/ttseng.dsp +++ b/platforms/windows/windows_sapi/ttseng.dsp @@ -124,6 +124,10 @@ SOURCE=.\src\intonation.cpp # End Source File # Begin Source File +SOURCE=.\src\klatt.cpp +# End Source File +# Begin Source File + SOURCE=.\src\numbers.cpp # End Source File # Begin Source File @@ -162,10 +166,6 @@ SOURCE=.\src\synthesize.cpp # End Source File # Begin Source File -SOURCE=.\src\tr_english.cpp -# End Source File -# Begin Source File - SOURCE=.\src\tr_languages.cpp # End Source File # Begin Source File @@ -209,6 +209,10 @@ SOURCE=.\src\wavegen.cpp # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File +SOURCE=.\src\klatt.h +# End Source File +# Begin Source File + SOURCE=.\src\phoneme.h # End Source File # Begin Source File @@ -249,10 +253,6 @@ SOURCE=.\src\synthesize.h # End Source File # Begin Source File -SOURCE=.\src\tr_languages.h -# End Source File -# Begin Source File - SOURCE=.\src\translate.h # End Source File # Begin Source File diff --git a/platforms/windows/windows_sapi/ttsengobj.cpp b/platforms/windows/windows_sapi/ttsengobj.cpp index 88463b93..0480ec93 100755 --- a/platforms/windows/windows_sapi/ttsengobj.cpp +++ b/platforms/windows/windows_sapi/ttsengobj.cpp @@ -68,6 +68,47 @@ int frag_count=0; FRAG_OFFSET *frag_offsets = NULL; +//#define TEST_INPUT // printf input text received from SAPI to espeak_text_log.txt +#ifdef TEST_INPUT +static int utf8_out(unsigned int c, char *buf) +{//==================================== +// write a unicode character into a buffer as utf8 +// returns the number of bytes written + int n_bytes; + int j; + int shift; + static char unsigned code[4] = {0,0xc0,0xe0,0xf0}; + + if(c < 0x80) + { + buf[0] = c; + return(1); + } + if(c >= 0x110000) + { + buf[0] = ' '; // out of range character code + return(1); + } + if(c < 0x0800) + n_bytes = 1; + else + if(c < 0x10000) + n_bytes = 2; + else + n_bytes = 3; + + shift = 6*n_bytes; + buf[0] = code[n_bytes] | (c >> shift); + for(j=0; j> shift) & 0x3f); + } + return(n_bytes+1); +} // end of utf8_out +#endif + + int VisemeCode(unsigned int phoneme_name) {//====================================== // Convert eSpeak phoneme name into a SAPI viseme code @@ -589,8 +630,32 @@ int CTTSEngObj::ProcessFragList(const SPVTEXTFRAG* pTextFragList, wchar_t *pW_st frag_offsets[frag_count].bufix = pW - pW_start; frag_offsets[frag_count].cmdlen = len; +#ifdef TEST_INPUT +{ +FILE *f; +unsigned int c; +int n; +char buf[10]; + +f = fopen("C:\\espeak_text_log.txt","a"); +if(f != NULL) +{ + fprintf(f,"----------\n"); + for(ix=0; ixulTextLen; ix++) + { + c = pTextFragList->pTextStart[ix]; + n = utf8_out(c,buf); + buf[n] = 0; + fprintf(f,"%s",buf); + } + fprintf(f,"\n"); + fclose(f); +} +} +#endif for(ix=0; ixulTextLen; ix++) { + *pW++ = pTextFragList->pTextStart[ix]; } if(pTextFragList->ulTextLen > 0) diff --git a/platforms/windows/windows_sapi/version.rc2 b/platforms/windows/windows_sapi/version.rc2 index 9357d412..a0b0fb01 100755 --- a/platforms/windows/windows_sapi/version.rc2 +++ b/platforms/windows/windows_sapi/version.rc2 @@ -5,8 +5,8 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,38,00 - PRODUCTVERSION 1,0,38,00 + FILEVERSION 1,0,40,00 + PRODUCTVERSION 1,0,40,00 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -24,14 +24,14 @@ BEGIN VALUE "Comments", "\0" VALUE "CompanyName", "Jonathan Duddington\0" VALUE "FileDescription", "Text to Speech\0" - VALUE "FileVersion", "1, 0,38,00\0" - VALUE "InternalName", "espeak1.38\0" + VALUE "FileVersion", "1, 0,40,00\0" + VALUE "InternalName", "espeak1.40\0" VALUE "LegalCopyright", "Copyright (c) Jonathan Duddington\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "espeak_sapi.dll\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "espeak TTS\0" - VALUE "ProductVersion", "1, 0, 38, 00\0" + VALUE "ProductVersion", "1, 0, 40, 00\0" VALUE "SpecialBuild", "\0" END END diff --git a/src/extras.cpp b/src/extras.cpp index 62c03ce2..3795a2be 100644 --- a/src/extras.cpp +++ b/src/extras.cpp @@ -1178,7 +1178,7 @@ void TestTest(int control) //CharsetToUnicode("ISO-8859-4"); //CharsetToUnicode("ISCII"); -TestCompile2(); +//TestCompile2(); return; if(control==2) diff --git a/src/formantdlg.cpp b/src/formantdlg.cpp index b8537ee8..3b686ae1 100755 --- a/src/formantdlg.cpp +++ b/src/formantdlg.cpp @@ -168,6 +168,8 @@ FormantDlg::FormantDlg(wxWindow *parent) : wxPanel(parent,-1,wxDefaultPosition,w t_pitch = new wxStaticText(this,-1,_T(""),wxPoint(4,520),wxSize(192,24)); + HideFields(0); + pitchgraph = new ByteGraph(this,wxPoint(0,538),wxSize(200,140)); pitchgraph->SetData(128,env_fall); pitchgraph->ShowSpectrum(1); diff --git a/src/spectseq.cpp b/src/spectseq.cpp index 24fe0293..27f7f9e2 100755 --- a/src/spectseq.cpp +++ b/src/spectseq.cpp @@ -34,7 +34,6 @@ #define MAX_HARMONIC 400 // 400 * 50Hz = 20 kHz, more than enough -#define KLATT_TEST extern void SetSynth_Klatt(int length, int modn, frame_t *fr1, frame_t *fr2, voice_t *v, int control); extern int Wavegen_Klatt(int resume); @@ -1027,7 +1026,9 @@ void SpectSeq::MakeWave(int start, int end, PitchEnvelope &pitch) peak_t peaks1[N_PEAKS]; peak_t peaks2[N_PEAKS]; +#ifdef KLATT_TEST KlattInit(); +#endif SpeakNextClause(NULL,NULL,2); // stop speaking file if(numframes==0) return; @@ -1158,7 +1159,9 @@ void SpectFrame::MakeWaveF(int control, PitchEnvelope &pitche, int amplitude, in int pbase; char *fname_speech; +#ifdef KLATT_TEST KlattInit(); +#endif SpeakNextClause(NULL,NULL,2); // stop speaking file length = duration; diff --git a/src/speech.h b/src/speech.h index 3a0007a5..423e573d 100755 --- a/src/speech.h +++ b/src/speech.h @@ -21,7 +21,7 @@ #include // conditional compilation options -#define INCLUDE_KLATT +//#define INCLUDE_KLATT #if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN #define ARCH_BIG diff --git a/src/synthdata.cpp b/src/synthdata.cpp index 1beff7a2..9f4013f7 100755 --- a/src/synthdata.cpp +++ b/src/synthdata.cpp @@ -35,7 +35,7 @@ #include "translate.h" #include "wave.h" -const char *version_string = "1.39.49 21.Dec.08"; +const char *version_string = "1.40 22.Dec.08"; const int version_phdata = 0x014000; int option_device_number = -1; diff --git a/src/transldlg.cpp b/src/transldlg.cpp index 52c1eb84..7f590197 100755 --- a/src/transldlg.cpp +++ b/src/transldlg.cpp @@ -249,7 +249,9 @@ void MakeWave2(PHONEME_LIST *p, int n_phonemes) char *fname_speech; int n_ph; +#ifdef KLATT_TEST KlattInit(); +#endif n_ph = n_phonemes; fname_speech = WavFileName(); OpenWaveFile2(fname_speech);

    • _0M1The word for "thousand"
      _0M2The word for "million"
      _0M3The word for 1000000000
      _1M1  _2T1Special pronunciation for one thousand, two thousand, tc, if needed
      _1M1  _2M1Special pronunciation for one thousand, two thousand, tc, if needed
      _0andWord for "and" when speaking numbers (eg. "two hundred and twenty").
      _dptWord spoken for the decimnal point/comma
      _dpt2Word spoken (if any) at the end of all the digits after a decimal point.