Browse Source

maintainability: move variables to files where they are used, allowing removal of unnecessary extern declarations

master
Juho Hiltunen 7 years ago
parent
commit
d196d93ed5

+ 0
- 12
src/libespeak-ng/intonation.c View File

{ PITCHfall, 70, 18, PITCHfall, 70, 24, NULL, 32, 20, 0 }, // 12 test { PITCHfall, 70, 18, PITCHfall, 70, 24, NULL, 32, 20, 0 }, // 12 test
}; };


// index by 0=. 1=, 2=?, 3=! 4=none, 5=emphasized
unsigned char punctuation_to_tone[INTONATION_TYPES][PUNCT_INTONATIONS] = {
{ 0, 1, 2, 3, 0, 4 },
{ 0, 1, 2, 3, 0, 4 },
{ 5, 6, 2, 3, 0, 4 },
{ 5, 7, 1, 3, 0, 4 },
{ 8, 9, 10, 3, 0, 0 },
{ 8, 8, 10, 3, 0, 0 },
{ 11, 11, 11, 11, 0, 0 }, // 6 test
{ 12, 12, 12, 12, 0, 0 }
};

int n_tunes = 0; int n_tunes = 0;
TUNE *tunes = NULL; TUNE *tunes = NULL;



+ 0
- 18
src/libespeak-ng/readclause.c View File

return CLAUSE_NONE; return CLAUSE_NONE;
} }


const int param_defaults[N_SPEECH_PARAM] = {
0, // silence (internal use)
175, // rate wpm
100, // volume
50, // pitch
50, // range
0, // punctuation
0, // capital letters
0, // wordgap
0, // options
0, // intonation
0,
0,
0, // emphasis
0, // line length
0, // voice type
};

int towlower2(unsigned int c) int towlower2(unsigned int c)
{ {
// check for non-standard upper to lower case conversions // check for non-standard upper to lower case conversions

+ 0
- 1
src/libespeak-ng/readclause.h View File

} PARAM_STACK; } PARAM_STACK;


extern PARAM_STACK param_stack[]; extern PARAM_STACK param_stack[];
extern const int param_defaults[N_SPEECH_PARAM];


int clause_type_from_codepoint(uint32_t c); int clause_type_from_codepoint(uint32_t c);
int towlower2(unsigned int c); // Supports Turkish I int towlower2(unsigned int c); // Supports Turkish I

+ 1
- 0
src/libespeak-ng/setlengths.c View File



int new_value = value; int new_value = value;
int default_value; int default_value;
extern const int *param_defaults;


if (relative) { if (relative) {
if (parameter < 5) { if (parameter < 5) {

+ 5
- 0
src/libespeak-ng/setlengths.h View File



void CalcLengths(Translator *tr); void CalcLengths(Translator *tr);


espeak_ng_STATUS SetParameter(int parameter,
int value,
int relative
);

#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

+ 20
- 0
src/libespeak-ng/speech.c View File

strcpy(path_home, PATH_ESPEAK_DATA); strcpy(path_home, PATH_ESPEAK_DATA);
} }


const int param_defaults[N_SPEECH_PARAM] = {
0, // silence (internal use)
175, // rate wpm
100, // volume
50, // pitch
50, // range
0, // punctuation
0, // capital letters
0, // wordgap
0, // options
0, // intonation
0,
0,
0, // emphasis
0, // line length
0, // voice type
};


ESPEAK_NG_API espeak_ng_STATUS espeak_ng_Initialize(espeak_ng_ERROR_CONTEXT *context) ESPEAK_NG_API espeak_ng_STATUS espeak_ng_Initialize(espeak_ng_ERROR_CONTEXT *context)
{ {
int param; int param;
return ENS_OK; return ENS_OK;
} }


const char *version_string = PACKAGE_VERSION;
ESPEAK_API const char *espeak_Info(const char **ptr) ESPEAK_API const char *espeak_Info(const char **ptr)
{ {
if (ptr != NULL) if (ptr != NULL)

+ 1
- 0
src/libespeak-ng/synth_mbrola.c View File

#include "dictionary.h" #include "dictionary.h"
#include "mbrola.h" #include "mbrola.h"
#include "readclause.h" #include "readclause.h"
#include "setlengths.h"
#include "synthdata.h" #include "synthdata.h"
#include "wavegen.h" #include "wavegen.h"



+ 0
- 1
src/libespeak-ng/synthdata.c View File

#include "synthesize.h" #include "synthesize.h"
#include "translate.h" #include "translate.h"


const char *version_string = PACKAGE_VERSION;
const int version_phdata = 0x014801; const int version_phdata = 0x014801;


// copy the current phoneme table into here // copy the current phoneme table into here

+ 0
- 2
src/libespeak-ng/synthesize.h View File

extern unsigned char *out_end; extern unsigned char *out_end;
extern espeak_EVENT *event_list; extern espeak_EVENT *event_list;
extern t_espeak_callback *synth_callback; extern t_espeak_callback *synth_callback;
extern const char *version_string;
extern const int version_phdata; extern const int version_phdata;


#define N_SOUNDICON_TAB 80 // total entries in soundicon_tab #define N_SOUNDICON_TAB 80 // total entries in soundicon_tab
extern int n_soundicon_tab; extern int n_soundicon_tab;
extern SOUND_ICON soundicon_tab[N_SOUNDICON_TAB]; extern SOUND_ICON soundicon_tab[N_SOUNDICON_TAB];


espeak_ng_STATUS SetParameter(int parameter, int value, int relative);
void DoEmbedded(int *embix, int sourceix); void DoEmbedded(int *embix, int sourceix);
void DoMarker(int type, int char_posn, int length, int value); void DoMarker(int type, int char_posn, int length, int value);
void DoPhonemeMarker(int type, int char_posn, int length, char *name); void DoPhonemeMarker(int type, int char_posn, int length, char *name);

+ 12
- 0
src/libespeak-ng/tr_languages.c View File

tr->langopts.break_numbers = BREAK_THOUSANDS; // 1000, 1000,000 1,000,000 etc tr->langopts.break_numbers = BREAK_THOUSANDS; // 1000, 1000,000 1,000,000 etc
tr->langopts.max_digits = 14; tr->langopts.max_digits = 14;


// index by 0=. 1=, 2=?, 3=! 4=none, 5=emphasized
unsigned char punctuation_to_tone[INTONATION_TYPES][PUNCT_INTONATIONS] = {
{ 0, 1, 2, 3, 0, 4 },
{ 0, 1, 2, 3, 0, 4 },
{ 5, 6, 2, 3, 0, 4 },
{ 5, 7, 1, 3, 0, 4 },
{ 8, 9, 10, 3, 0, 0 },
{ 8, 8, 10, 3, 0, 0 },
{ 11, 11, 11, 11, 0, 0 }, // 6 test
{ 12, 12, 12, 12, 0, 0 }
};

memcpy(tr->punct_to_tone, punctuation_to_tone, sizeof(tr->punct_to_tone)); memcpy(tr->punct_to_tone, punctuation_to_tone, sizeof(tr->punct_to_tone));


memcpy(tr->langopts.tunes, default_tunes, sizeof(tr->langopts.tunes)); memcpy(tr->langopts.tunes, default_tunes, sizeof(tr->langopts.tunes));

+ 0
- 1
src/libespeak-ng/translate.h View File



#define N_PUNCTLIST 60 #define N_PUNCTLIST 60
extern wchar_t option_punctlist[N_PUNCTLIST]; // which punctuation characters to announce extern wchar_t option_punctlist[N_PUNCTLIST]; // which punctuation characters to announce
extern unsigned char punctuation_to_tone[INTONATION_TYPES][PUNCT_INTONATIONS];


extern Translator *translator; extern Translator *translator;
extern Translator *translator2; extern Translator *translator2;

Loading…
Cancel
Save