#include "translate.h" | #include "translate.h" | ||||
static FILE *f_log = NULL; | static FILE *f_log = NULL; | ||||
extern char *dir_dictionary; | |||||
extern char word_phonemes[N_WORD_PHONEMES]; // a word translated into phoneme codes | extern char word_phonemes[N_WORD_PHONEMES]; // a word translated into phoneme codes | ||||
#define phonPAUSE_CLAUSE 27 | #define phonPAUSE_CLAUSE 27 | ||||
#define phonVOWELTYPES 28 // 28 to 33 | #define phonVOWELTYPES 28 // 28 to 33 | ||||
extern const unsigned char pause_phonemes[8]; // 0, vshort, short, pause, long, glottalstop | |||||
#define N_PHONEME_TABS 150 // number of phoneme tables | #define N_PHONEME_TABS 150 // number of phoneme tables | ||||
#define N_PHONEME_TAB 256 // max phonemes in a phoneme table | #define N_PHONEME_TAB 256 // max phonemes in a phoneme table | ||||
#define N_PHONEME_TAB_NAME 32 // must be multiple of 4 | #define N_PHONEME_TAB_NAME 32 // must be multiple of 4 |
#include "spect.h" | #include "spect.h" | ||||
#include "ieee80.h" | #include "ieee80.h" | ||||
extern unsigned char pk_shape1[]; | |||||
extern int pk_select; | |||||
extern char voice_name[]; | extern char voice_name[]; | ||||
static int frame_width; | static int frame_width; | ||||
int pk_select; | |||||
static int default_freq[N_PEAKS] = | static int default_freq[N_PEAKS] = | ||||
{ 200, 500, 1200, 3000, 3500, 4000, 6900, 7800, 9000 }; | { 200, 500, 1200, 3000, 3500, 4000, 6900, 7800, 9000 }; | ||||
spect->frames = NULL; | spect->frames = NULL; | ||||
spect->name = NULL; | spect->name = NULL; | ||||
pk_select = 1; | |||||
spect->grid = 1; | spect->grid = 1; | ||||
spect->duration = 0; | spect->duration = 0; | ||||
spect->pitch1 = 0; | spect->pitch1 = 0; |
int wavefile_ix; // a wavefile to play along with the synthesis | int wavefile_ix; // a wavefile to play along with the synthesis | ||||
int wavefile_amp; | int wavefile_amp; | ||||
int wavefile_ix2; | |||||
int wavefile_amp2; | |||||
int seq_len_adjust; | int seq_len_adjust; | ||||
int vowel_transition[4]; | int vowel_transition[4]; | ||||
int vowel_transition0; | |||||
int vowel_transition1; | |||||
static espeak_ng_STATUS ReadPhFile(void **ptr, const char *fname, int *size, espeak_ng_ERROR_CONTEXT *context) | static espeak_ng_STATUS ReadPhFile(void **ptr, const char *fname, int *size, espeak_ng_ERROR_CONTEXT *context) | ||||
{ | { |
extern int wavefile_ix; | extern int wavefile_ix; | ||||
extern int wavefile_amp; | extern int wavefile_amp; | ||||
extern int wavefile_ix2; | |||||
extern int wavefile_amp2; | |||||
extern int vowel_transition[4]; | extern int vowel_transition[4]; | ||||
extern int vowel_transition0, vowel_transition1; | |||||
#define N_ECHO_BUF 5500 // max of 250mS at 22050 Hz | #define N_ECHO_BUF 5500 // max of 250mS at 22050 Hz | ||||
extern int echo_head; | extern int echo_head; | ||||
extern int formant_rate[]; // max rate of change of each formant | extern int formant_rate[]; // max rate of change of each formant | ||||
extern SPEED_FACTORS speed; | extern SPEED_FACTORS speed; | ||||
extern long count_samples; | |||||
extern unsigned char *out_ptr; | extern unsigned char *out_ptr; | ||||
extern unsigned char *out_start; | extern unsigned char *out_start; | ||||
extern unsigned char *out_end; | extern unsigned char *out_end; | ||||
extern int event_list_ix; | |||||
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 char *version_string; | ||||
extern const int version_phdata; | extern const int version_phdata; | ||||
extern double sonicSpeed; | |||||
#define N_SOUNDICON_TAB 80 // total entries in soundicon_tab | #define N_SOUNDICON_TAB 80 // total entries in soundicon_tab | ||||
#define N_SOUNDICON_SLOTS 4 // number of slots reserved for dynamic loading of audio files | #define N_SOUNDICON_SLOTS 4 // number of slots reserved for dynamic loading of audio files |
return count; | return count; | ||||
} | } | ||||
extern char *phondata_ptr; | |||||
static int TranslateWord3(Translator *tr, char *word_start, WORD_TAB *wtab, char *word_out) | static int TranslateWord3(Translator *tr, char *word_start, WORD_TAB *wtab, char *word_out) | ||||
{ | { | ||||
// word1 is terminated by space (0x20) character | // word1 is terminated by space (0x20) character |
int flags; | int flags; | ||||
} ALPHABET; | } ALPHABET; | ||||
extern ALPHABET alphabets[]; | |||||
extern ALPHABET *current_alphabet; | extern ALPHABET *current_alphabet; | ||||
// alphabet flags | // alphabet flags | ||||
#define AL_DONT_NAME 0x01 // don't speak the alphabet name | #define AL_DONT_NAME 0x01 // don't speak the alphabet name | ||||
extern int option_wordgap; | extern int option_wordgap; | ||||
extern int count_characters; | extern int count_characters; | ||||
extern int count_words; | |||||
extern int count_sentences; | extern int count_sentences; | ||||
extern int skip_characters; | extern int skip_characters; | ||||
extern int skip_words; | extern int skip_words; |
int current_source_index = 0; | int current_source_index = 0; | ||||
extern FILE *f_wave; | |||||
#if HAVE_SONIC_H | #if HAVE_SONIC_H | ||||
static sonicStream sonicSpeedupStream = NULL; | static sonicStream sonicSpeedupStream = NULL; | ||||
double sonicSpeed = 1.0; | double sonicSpeed = 1.0; |