summaryrefslogtreecommitdiff
path: root/navit/support/espeak/phoneme.h
diff options
context:
space:
mode:
Diffstat (limited to 'navit/support/espeak/phoneme.h')
-rw-r--r--[-rwxr-xr-x]navit/support/espeak/phoneme.h72
1 files changed, 37 insertions, 35 deletions
diff --git a/navit/support/espeak/phoneme.h b/navit/support/espeak/phoneme.h
index 596f457ef..9a2e13913 100755..100644
--- a/navit/support/espeak/phoneme.h
+++ b/navit/support/espeak/phoneme.h
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2005 to 2007 by Jonathan Duddington *
+ * Copyright (C) 2005 to 2010 by Jonathan Duddington *
* email: jonsd@users.sourceforge.net *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -35,7 +35,8 @@
// phoneme properties
-// bits 16-19 give place of articulation (not currently used)
+// bits 16-19 give place of articulation
+#define phARTICULATION 0xf0000
#define phWAVE 0x01
#define phUNSTRESSED 0x02
#define phFORTIS 0x08
@@ -45,22 +46,20 @@
#define phTRILL 0x80
#define phVOWEL2 0x100 // liquid that is considered a vowel
#define phPALATAL 0x200
-#define phAPPENDPH 0x2000 // always insert another phoneme (link_out) after this one
+#define phSINGLE_INSTN 0x1000 // this phoneme has a single instruction program, with an implicit Return
#define phBRKAFTER 0x4000 // [*] add a post-pause
-#define phBEFOREPAUSE 0x8000 // replace with the link_out phoneme if the next phoneme is a pause
-#define phALTERNATIVE 0x1c00 // bits 10,11,12 specifying use of alternative_ph
-#define phBEFOREVOWEL 0x0000
-#define phBEFOREVOWELPAUSE 0x0400
-#define phBEFORENOTVOWEL 0x0c00
-#define phBEFORENOTVOWEL2 0x1000
-#define phSWITCHVOICING 0x0800
-#define phBEFORE_R 0x1400
-
-#define phNONSYLLABIC 0x100000 // don't count this vowel as a syllable when finding the stress position
+#define phNONSYLLABIC 0x100000 // don't count this vowel as a syllable when finding the stress position
#define phLONG 0x200000
#define phLENGTHENSTOP 0x400000 // make the pre-pause slightly longer
-#define phRHOTIC 0x800000
+#define phRHOTIC 0x800000 // bit 23
+#define phNOPAUSE 0x1000000
+#define phPREVOICE 0x2000000 // for voiced stops
+
+#define phFLAG1 0x10000000
+#define phFLAG2 0x20000000
+#define phFLAG3 0x40000000
+#define phLOCAL 0x80000000 // used during compilation
// fixed phoneme code numbers, these can be used from the program code
#define phonCONTROL 1
@@ -78,7 +77,6 @@
#define phonSCHWA 13
#define phonSCHWA_SHORT 14
#define phonEND_WORD 15
-#define phonSONORANT 16
#define phonDEFAULTTONE 17
#define phonCAPITAL 18
#define phonGLOTTALSTOP 19
@@ -90,11 +88,13 @@
#define phonT_REDUCED 25
#define phonSTRESS_TONIC 26
#define phonPAUSE_CLAUSE 27
+#define phonVOWELTYPES 28 // 28 to 33
extern const unsigned char pause_phonemes[8]; // 0, vshort, short, pause, long, glottalstop
// place of articulation
#define phPLACE 0xf0000
+#define phPLACE_blb 0x10000
#define phPLACE_pla 0x60000
#define N_PHONEME_TABS 100 // number of phoneme tables
@@ -102,29 +102,22 @@ extern const unsigned char pause_phonemes[8]; // 0, vshort, short, pause, long,
#define N_PHONEME_TAB_NAME 32 // must be multiple of 4
// main table of phonemes, index by phoneme number (1-254)
-typedef struct {
- unsigned int mnemonic; // 1st char is in the l.s.byte
- unsigned int phflags; // bits 28-30 reduce_to level, bits 16-19 place of articulation
- // bits 10-11 alternative ph control
- unsigned short std_length; // for vowels, in mS; for phSTRESS, the stress/tone type
- unsigned short spect;
- unsigned short before;
- unsigned short after;
-
- unsigned char code; // the phoneme number
- unsigned char type; // phVOWEL, phPAUSE, phSTOP etc
+typedef struct {
+ unsigned int mnemonic; // Up to 4 characters. The first char is in the l.s.byte
+ unsigned int phflags; // bits 16-19 place of articulation
+ unsigned short program; // index into phondata file
+ unsigned char code; // the phoneme number
+ unsigned char type; // phVOWEL, phPAUSE, phSTOP etc
unsigned char start_type;
unsigned char end_type;
-
- unsigned char length_mod; // a length_mod group number, used to access length_mod_tab
- unsigned char reduce_to; // change to this phoneme if unstressed
- unsigned char alternative_ph; // change to this phoneme if a vowel follows/doesn't follow
- unsigned char link_out; // insert linking phoneme if a vowel follows
-
+ unsigned char std_length; // for vowels, in mS/2; for phSTRESS phonemes, this is the stress/tone type
+ unsigned char length_mod; // a length_mod group number, used to access length_mod_tab
+
} PHONEME_TAB;
+
// Several phoneme tables may be loaded into memory. phoneme_tab points to
// one for the current voice
extern int n_phoneme_tab;
@@ -136,7 +129,8 @@ typedef struct {
char name[N_PHONEME_TAB_NAME];
PHONEME_TAB *phoneme_tab_ptr;
int n_phonemes;
- int includes; // also include the phonemes from this other phoneme table
+ int includes; // also include the phonemes from this other phoneme table
+ int equivalence_tables; // lists of equivalent phonemes to match other languages, byte index into phondata
} PHONEME_TAB_LIST;
@@ -153,13 +147,21 @@ extern int n_replace_phonemes;
extern REPLACE_PHONEMES replace_phonemes[N_REPLACE_PHONEMES];
-#define PH(c1,c2) (c2<<8)+c1 // combine two characters into an integer for phoneme name
+// Table of phoneme programs and lengths. Used by MakeVowelLists
+typedef struct {
+ unsigned int addr;
+ unsigned int length;
+} PHONEME_PROG_LOG;
+
+
+
+#define PH(c1,c2) (c2<<8)+c1 // combine two characters into an integer for phoneme name
#define PH3(c1,c2,c3) (c3<<16)+(c2<<8)+c1
#define PhonemeCode2(c1,c2) PhonemeCode((c2<<8)+c1)
int LookupPhonemeString(const char *string);
int PhonemeCode(unsigned int mnem);
-char *EncodePhonemes(char *p, char *outptr, unsigned char *bad_phoneme);
+const char *EncodePhonemes(const char *p, char *outptr, int *bad_phoneme);
void DecodePhonemes(const char *inptr, char *outptr);
extern const char *WordToString(unsigned int word);