diff --git a/src/libespeak-ng/compiledata.c b/src/libespeak-ng/compiledata.c index 250b78b3..245dbb77 100644 --- a/src/libespeak-ng/compiledata.c +++ b/src/libespeak-ng/compiledata.c @@ -35,6 +35,8 @@ #include #include +#include "readclause.h" + #include "error.h" #include "phoneme.h" #include "voice.h" diff --git a/src/libespeak-ng/compiledict.c b/src/libespeak-ng/compiledict.c index 2a472f49..7e5857c4 100644 --- a/src/libespeak-ng/compiledict.c +++ b/src/libespeak-ng/compiledict.c @@ -33,6 +33,8 @@ #include #include +#include "readclause.h" + #include "error.h" #include "speech.h" #include "phoneme.h" diff --git a/src/libespeak-ng/dictionary.c b/src/libespeak-ng/dictionary.c index 5ab68fe4..8832f6b4 100644 --- a/src/libespeak-ng/dictionary.c +++ b/src/libespeak-ng/dictionary.c @@ -31,6 +31,8 @@ #include #include +#include "readclause.h" + #include "speech.h" #include "phoneme.h" #include "voice.h" diff --git a/src/libespeak-ng/numbers.c b/src/libespeak-ng/numbers.c index 8c9ad205..06ba264c 100644 --- a/src/libespeak-ng/numbers.c +++ b/src/libespeak-ng/numbers.c @@ -31,6 +31,8 @@ #include #include +#include "readclause.h" + #include "phoneme.h" #include "voice.h" #include "synthesize.h" diff --git a/src/libespeak-ng/readclause.c b/src/libespeak-ng/readclause.c index 42cfe54e..2a9cb1b1 100644 --- a/src/libespeak-ng/readclause.c +++ b/src/libespeak-ng/readclause.c @@ -36,6 +36,8 @@ #include #include +#include "readclause.h" + #include "error.h" #include "speech.h" #include "phoneme.h" diff --git a/src/libespeak-ng/readclause.h b/src/libespeak-ng/readclause.h new file mode 100644 index 00000000..3a1bb37e --- /dev/null +++ b/src/libespeak-ng/readclause.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2005 to 2015 by Jonathan Duddington + * email: jonsd@users.sourceforge.net + * Copyright (C) 2015-2018 Reece H. Dunn + * Copyright (C) 2018 Juho Hiltunen + * + * 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 3 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, see: . + */ +#ifndef ESPEAK_NG_READCLAUSE_H +#define ESPEAK_NG_READCLAUSE_H + +#include "translate.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +typedef struct { + int type; + int parameter[N_SPEECH_PARAM]; +} PARAM_STACK; + +extern PARAM_STACK param_stack[]; +extern const int param_defaults[N_SPEECH_PARAM]; + + int clause_type_from_codepoint(uint32_t c); +int towlower2(unsigned int c); // Supports Turkish I +int Eof(void); +const char *WordToString2(unsigned int word); +int Read4Bytes(FILE *f); +int LoadSoundFile2(const char *fname); +int AddNameData(const char *name, + int wide); +int ReadClause(Translator *tr, + char *buf, + short *charix, + int *charix_top, + int n_buf, + int *tone_type, + char *voice_change); + + + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/libespeak-ng/setlengths.c b/src/libespeak-ng/setlengths.c index 831e2f51..367cd883 100644 --- a/src/libespeak-ng/setlengths.c +++ b/src/libespeak-ng/setlengths.c @@ -28,6 +28,8 @@ #include #include +#include "readclause.h" + #include "phoneme.h" #include "voice.h" #include "synthesize.h" diff --git a/src/libespeak-ng/speech.c b/src/libespeak-ng/speech.c index 7dc58e65..0dfe3bdd 100644 --- a/src/libespeak-ng/speech.c +++ b/src/libespeak-ng/speech.c @@ -48,6 +48,8 @@ #include #include +#include "readclause.h" + #include "speech.h" #include "phoneme.h" #include "voice.h" diff --git a/src/libespeak-ng/ssml.c b/src/libespeak-ng/ssml.c index 6c566596..6af0eb15 100644 --- a/src/libespeak-ng/ssml.c +++ b/src/libespeak-ng/ssml.c @@ -39,6 +39,8 @@ #include #include +#include "readclause.h" + #include "error.h" #include "speech.h" #include "phoneme.h" diff --git a/src/libespeak-ng/ssml.h b/src/libespeak-ng/ssml.h index f47f213c..29cd1530 100644 --- a/src/libespeak-ng/ssml.h +++ b/src/libespeak-ng/ssml.h @@ -62,11 +62,6 @@ typedef struct { #define HTML_NOSPACE 16 // don't insert a space for this element, so it doesn't break a word #define SSML_CLOSE 0x20 // for a closing tag, OR this with the tag type -int LoadSoundFile2(const char *fname); - -int AddNameData(const char *name, - int wide); - int ProcessSsmlTag(wchar_t *xml_buf, char *outbuf, int *outix, diff --git a/src/libespeak-ng/synth_mbrola.c b/src/libespeak-ng/synth_mbrola.c index b3473f8e..534b0163 100644 --- a/src/libespeak-ng/synth_mbrola.c +++ b/src/libespeak-ng/synth_mbrola.c @@ -32,6 +32,8 @@ #include #include +#include "readclause.h" + #include "speech.h" #include "phoneme.h" #include "voice.h" diff --git a/src/libespeak-ng/synthdata.c b/src/libespeak-ng/synthdata.c index 81ce99d4..019c2f6f 100644 --- a/src/libespeak-ng/synthdata.c +++ b/src/libespeak-ng/synthdata.c @@ -31,6 +31,8 @@ #include #include +#include "readclause.h" + #include "error.h" #include "speech.h" #include "phoneme.h" diff --git a/src/libespeak-ng/synthesize.h b/src/libespeak-ng/synthesize.h index d5b3a50b..5299174b 100644 --- a/src/libespeak-ng/synthesize.h +++ b/src/libespeak-ng/synthesize.h @@ -513,7 +513,6 @@ 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); -int Read4Bytes(FILE *f); int Reverse4Bytes(int word); #if HAVE_SONIC_H diff --git a/src/libespeak-ng/translate.c b/src/libespeak-ng/translate.c index 3ab9d939..7666d169 100644 --- a/src/libespeak-ng/translate.c +++ b/src/libespeak-ng/translate.c @@ -32,6 +32,8 @@ #include #include +#include "readclause.h" + #include "speech.h" #include "phoneme.h" #include "voice.h" diff --git a/src/libespeak-ng/translate.h b/src/libespeak-ng/translate.h index e5e2b2cb..7dfccc9d 100644 --- a/src/libespeak-ng/translate.h +++ b/src/libespeak-ng/translate.h @@ -246,8 +246,6 @@ extern "C" #define CLAUSE_COLON (30 | CLAUSE_INTONATION_FULL_STOP | CLAUSE_TYPE_CLAUSE) #define CLAUSE_SEMICOLON (30 | CLAUSE_INTONATION_COMMA | CLAUSE_TYPE_CLAUSE) -int clause_type_from_codepoint(uint32_t c); - //@} #define SAYAS_CHARS 0x12 @@ -277,14 +275,6 @@ typedef struct { unsigned char length; } WORD_TAB; -typedef struct { - int type; - int parameter[N_SPEECH_PARAM]; -} PARAM_STACK; - -extern PARAM_STACK param_stack[]; -extern const int param_defaults[N_SPEECH_PARAM]; - typedef struct { const char *name; int offset; @@ -711,7 +701,6 @@ int utf8_nbytes(const char *buf); int lookupwchar(const unsigned short *list, int c); int lookupwchar2(const unsigned short *list, int c); -int Eof(void); char *strchr_w(const char *s, int c); int IsBracket(int c); void InitNamedata(void); @@ -723,9 +712,7 @@ int IsAlpha(unsigned int c); int IsVowel(Translator *tr, int c); int IsSuperscript(int letter); int isspace2(unsigned int c); -int towlower2(unsigned int c); // Supports Turkish I const char *GetTranslatedPhonemeString(int phoneme_mode); -const char *WordToString2(unsigned int word); ALPHABET *AlphabetFromChar(int c); Translator *SelectTranslator(const char *name); @@ -764,7 +751,6 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, int TranslateRules(Translator *tr, char *p, char *phonemes, int size, char *end_phonemes, int end_flags, unsigned int *dict_flags); int TranslateWord(Translator *tr, char *word1, WORD_TAB *wtab, char *word_out); void TranslateClause(Translator *tr, int *tone, char **voice_change); -int ReadClause(Translator *tr, char *buf, short *charix, int *charix_top, int n_buf, int *tone_type, char *voice_change); void SetVoiceStack(espeak_VOICE *v, const char *variant_name); void InterpretPhoneme(Translator *tr, int control, PHONEME_LIST *plist, PHONEME_DATA *phdata, WORD_PH_DATA *worddata); diff --git a/src/libespeak-ng/voices.c b/src/libespeak-ng/voices.c index 78cef626..db5f131e 100644 --- a/src/libespeak-ng/voices.c +++ b/src/libespeak-ng/voices.c @@ -38,6 +38,8 @@ #include #include +#include "readclause.h" + #include "speech.h" #include "phoneme.h" #include "voice.h"