From 01e289c3d72a3fa387166d7766ae3761081062c0 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 29 Jan 2017 00:24:38 +0000 Subject: [PATCH] Use constants for the phARTICULATION values. --- src/libespeak-ng/phoneme.c | 28 ++++++++++++++-------------- src/libespeak-ng/phoneme.h | 14 ++++++++++++++ src/libespeak-ng/synthesize.h | 2 +- 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/src/libespeak-ng/phoneme.c b/src/libespeak-ng/phoneme.c index d6883cfc..96af512a 100644 --- a/src/libespeak-ng/phoneme.c +++ b/src/libespeak-ng/phoneme.c @@ -73,60 +73,60 @@ phoneme_add_feature(PHONEME_TAB *phoneme, // place of articulation case blb: phoneme->phflags &= ~phARTICULATION; - phoneme->phflags |= 1 << 16; + phoneme->phflags |= phPLACE_BILABIAL << 16; break; case lbd: phoneme->phflags &= ~phARTICULATION; - phoneme->phflags |= 2 << 16; + phoneme->phflags |= phPLACE_LABIODENTAL << 16; break; case dnt: phoneme->phflags &= ~phARTICULATION; - phoneme->phflags |= 3 << 16; + phoneme->phflags |= phPLACE_DENTAL << 16; break; case alv: phoneme->phflags &= ~phARTICULATION; - phoneme->phflags |= 4 << 16; + phoneme->phflags |= phPLACE_ALVEOLAR << 16; break; case rfx: phoneme->phflags &= ~phARTICULATION; - phoneme->phflags |= 5 << 16; + phoneme->phflags |= phPLACE_RETROFLEX << 16; break; case pla: phoneme->phflags &= ~phARTICULATION; - phoneme->phflags |= 6 << 16; + phoneme->phflags |= phPLACE_PALATO_ALVEOLAR << 16; break; case pal: phoneme->phflags &= ~phARTICULATION; - phoneme->phflags |= 7 << 16; + phoneme->phflags |= phPLACE_PALATAL << 16; phoneme->phflags |= phPALATAL; break; case vel: phoneme->phflags &= ~phARTICULATION; - phoneme->phflags |= 8 << 16; + phoneme->phflags |= phPLACE_VELAR << 16; break; case lbv: phoneme->phflags &= ~phARTICULATION; - phoneme->phflags |= 9 << 16; + phoneme->phflags |= phPLACE_LABIO_VELAR << 16; break; case uvl: phoneme->phflags &= ~phARTICULATION; - phoneme->phflags |= 10 << 16; + phoneme->phflags |= phPLACE_UVULAR << 16; break; case phr: phoneme->phflags &= ~phARTICULATION; - phoneme->phflags |= 11 << 16; + phoneme->phflags |= phPLACE_PHARYNGEAL << 16; break; case glt: phoneme->phflags &= ~phARTICULATION; - phoneme->phflags |= 12 << 16; + phoneme->phflags |= phPLACE_GLOTTAL << 16; break; case bld: phoneme->phflags &= ~phARTICULATION; - phoneme->phflags |= 1 << 16; // bilabial + phoneme->phflags |= phPLACE_BILABIAL << 16; break; case alp: // pla pzd phoneme->phflags &= ~phARTICULATION; - phoneme->phflags |= 6 << 16; + phoneme->phflags |= phPLACE_PALATO_ALVEOLAR << 16; phoneme->phflags |= phPALATAL; break; // voice diff --git a/src/libespeak-ng/phoneme.h b/src/libespeak-ng/phoneme.h index a723c35e..0f18ef80 100644 --- a/src/libespeak-ng/phoneme.h +++ b/src/libespeak-ng/phoneme.h @@ -137,6 +137,20 @@ phoneme_feature_t phoneme_feature_from_string(const char *feature); #define phDELETED 14 #define phINVALID 15 +// places of articulation (phARTICULATION) +#define phPLACE_BILABIAL 1 +#define phPLACE_LABIODENTAL 2 +#define phPLACE_DENTAL 3 +#define phPLACE_ALVEOLAR 4 +#define phPLACE_RETROFLEX 5 +#define phPLACE_PALATO_ALVEOLAR 6 +#define phPLACE_PALATAL 7 +#define phPLACE_VELAR 8 +#define phPLACE_LABIO_VELAR 9 +#define phPLACE_UVULAR 10 +#define phPLACE_PHARYNGEAL 11 +#define phPLACE_GLOTTAL 12 + // phflags #define phFLAGBIT_UNSTRESSED 1 #define phFLAGBIT_VOICELESS 3 diff --git a/src/libespeak-ng/synthesize.h b/src/libespeak-ng/synthesize.h index c437de14..e8f25ba4 100644 --- a/src/libespeak-ng/synthesize.h +++ b/src/libespeak-ng/synthesize.h @@ -333,7 +333,7 @@ typedef struct { #define i_isVel 0x28 #define CONDITION_IS_PHONEME_TYPE 0x00 -#define CONDITION_IS_PHFLAG_SET 0x40 +#define CONDITION_IS_PHFLAG_SET 0x40 #define i_StressLevel 0x800