From 9012f3f0bffdc15e3e7e027108cddcc538094223 Mon Sep 17 00:00:00 2001 From: Juho Hiltunen Date: Sat, 10 Mar 2018 13:21:27 +0200 Subject: [PATCH] headers: continue with synthdata.h --- src/libespeak-ng/compiledata.c | 3 ++- src/libespeak-ng/intonation.c | 1 + src/libespeak-ng/numbers.c | 1 + src/libespeak-ng/phoneme.h | 2 -- src/libespeak-ng/readclause.c | 1 + src/libespeak-ng/speech.c | 1 + src/libespeak-ng/synthdata.h | 27 +++++++++++++++++++++++++-- src/libespeak-ng/synthesize.h | 13 ------------- src/libespeak-ng/translate.c | 1 + src/libespeak-ng/translate.h | 2 -- src/libespeak-ng/voices.c | 1 + 11 files changed, 33 insertions(+), 20 deletions(-) diff --git a/src/libespeak-ng/compiledata.c b/src/libespeak-ng/compiledata.c index 245dbb77..8510395b 100644 --- a/src/libespeak-ng/compiledata.c +++ b/src/libespeak-ng/compiledata.c @@ -35,7 +35,8 @@ #include #include -#include "readclause.h" +#include "readclause.h" +#include "synthdata.h" #include "error.h" #include "phoneme.h" diff --git a/src/libespeak-ng/intonation.c b/src/libespeak-ng/intonation.c index 1b5a1c08..074516a0 100644 --- a/src/libespeak-ng/intonation.c +++ b/src/libespeak-ng/intonation.c @@ -29,6 +29,7 @@ #include #include "intonation.h" +#include "synthdata.h" #include "phoneme.h" #include "voice.h" diff --git a/src/libespeak-ng/numbers.c b/src/libespeak-ng/numbers.c index c05efd90..24843d9f 100644 --- a/src/libespeak-ng/numbers.c +++ b/src/libespeak-ng/numbers.c @@ -34,6 +34,7 @@ #include "dictionary.h" #include "numbers.h" #include "readclause.h" +#include "synthdata.h" #include "phoneme.h" #include "voice.h" diff --git a/src/libespeak-ng/phoneme.h b/src/libespeak-ng/phoneme.h index b617b368..82a3311e 100644 --- a/src/libespeak-ng/phoneme.h +++ b/src/libespeak-ng/phoneme.h @@ -282,8 +282,6 @@ typedef struct { #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); extern const char *WordToString(unsigned int word); diff --git a/src/libespeak-ng/readclause.c b/src/libespeak-ng/readclause.c index b2f2876a..52362de4 100644 --- a/src/libespeak-ng/readclause.c +++ b/src/libespeak-ng/readclause.c @@ -38,6 +38,7 @@ #include "dictionary.h" #include "readclause.h" +#include "synthdata.h" #include "error.h" #include "speech.h" diff --git a/src/libespeak-ng/speech.c b/src/libespeak-ng/speech.c index 4186f65a..858bf4ec 100644 --- a/src/libespeak-ng/speech.c +++ b/src/libespeak-ng/speech.c @@ -50,6 +50,7 @@ #include "dictionary.h" #include "readclause.h" +#include "synthdata.h" #include "speech.h" #include "phoneme.h" diff --git a/src/libespeak-ng/synthdata.h b/src/libespeak-ng/synthdata.h index d0926bfa..a199c96f 100644 --- a/src/libespeak-ng/synthdata.h +++ b/src/libespeak-ng/synthdata.h @@ -29,8 +29,31 @@ extern "C" { #endif -void InterpretPhoneme(Translator *tr, int control, PHONEME_LIST *plist, PHONEME_DATA *phdata, WORD_PH_DATA *worddata); -void InterpretPhoneme2(int phcode, PHONEME_DATA *phdata); +void InterpretPhoneme(Translator *tr, + int control, + PHONEME_LIST *plist, + PHONEME_DATA *phdata, + WORD_PH_DATA *worddata); + +void InterpretPhoneme2(int phcode, + PHONEME_DATA *phdata); + +void FreePhData(void); +unsigned char *GetEnvelope(int index); +espeak_ng_STATUS LoadPhData(int *srate, espeak_ng_ERROR_CONTEXT *context); +void LoadConfig(void); +int LookupPhonemeString(const char *string); +int LookupPhonemeTable(const char *name); +frameref_t *LookupSpect(PHONEME_TAB *this_ph, + int which, + FMT_PARAMS *fmt_params, + int *n_frames, + PHONEME_LIST *plist); + +int NumInstnWords(unsigned short *prog); +int PhonemeCode(unsigned int mnem); +void SelectPhonemeTable(int number); +int SelectPhonemeTableName(const char *name); #ifdef __cplusplus } diff --git a/src/libespeak-ng/synthesize.h b/src/libespeak-ng/synthesize.h index 7ad2a625..825dfc72 100644 --- a/src/libespeak-ng/synthesize.h +++ b/src/libespeak-ng/synthesize.h @@ -494,22 +494,12 @@ extern short echo_buf[N_ECHO_BUF]; extern int mbrola_delay; extern char mbrola_name[20]; -// from synthdata file -unsigned int LookupSound(PHONEME_TAB *ph1, PHONEME_TAB *ph2, int which, int *match_level, int control); -frameref_t *LookupSpect(PHONEME_TAB *this_ph, int which, FMT_PARAMS *fmt_params, int *n_frames, PHONEME_LIST *plist); -void FreePhData(void); - -unsigned char *LookupEnvelope(int ix); -espeak_ng_STATUS LoadPhData(int *srate, espeak_ng_ERROR_CONTEXT *context); - void SynthesizeInit(void); int Generate(PHONEME_LIST *phoneme_list, int *n_ph, bool resume); void MakeWave2(PHONEME_LIST *p, int n_ph); int SpeakNextClause(int control); void SetSpeed(int control); void SetEmbedded(int control, int value); -void SelectPhonemeTable(int number); -int SelectPhonemeTableName(const char *name); int FormantTransition2(frameref_t *seq, int *n_frames, unsigned int data1, unsigned int data2, PHONEME_TAB *other_ph, int which); void Write4Bytes(FILE *f, int value); @@ -555,9 +545,6 @@ void DoPhonemeMarker(int type, int char_posn, int length, char *name); int DoSample3(PHONEME_DATA *phdata, int length_mod, int amp); int DoSpect2(PHONEME_TAB *this_ph, int which, FMT_PARAMS *fmt_params, PHONEME_LIST *plist, int modulation); int PauseLength(int pause, int control); -int LookupPhonemeTable(const char *name); -unsigned char *GetEnvelope(int index); -int NumInstnWords(unsigned short *prog); void InitBreath(void); diff --git a/src/libespeak-ng/translate.c b/src/libespeak-ng/translate.c index 77abf6e5..ff0b0305 100644 --- a/src/libespeak-ng/translate.c +++ b/src/libespeak-ng/translate.c @@ -36,6 +36,7 @@ #include "numbers.h" #include "phonemelist.h" #include "readclause.h" +#include "synthdata.h" #include "speech.h" #include "phoneme.h" diff --git a/src/libespeak-ng/translate.h b/src/libespeak-ng/translate.h index 082f4c14..c71c8d4a 100644 --- a/src/libespeak-ng/translate.h +++ b/src/libespeak-ng/translate.h @@ -686,8 +686,6 @@ extern int (*uri_callback)(int, const char *, const char *); extern int (*phoneme_callback)(const char *); extern void SetLengthMods(Translator *tr, int value); -void LoadConfig(void); - #define LEADING_2_BITS 0xC0 // 0b11000000 #define UTF8_TAIL_BITS 0x80 // 0b10000000 diff --git a/src/libespeak-ng/voices.c b/src/libespeak-ng/voices.c index 9c3ceee9..4cd245c6 100644 --- a/src/libespeak-ng/voices.c +++ b/src/libespeak-ng/voices.c @@ -40,6 +40,7 @@ #include "dictionary.h" #include "readclause.h" +#include "synthdata.h" #include "speech.h" #include "phoneme.h"