#include <espeak-ng/espeak_ng.h> | #include <espeak-ng/espeak_ng.h> | ||||
#include <espeak-ng/speak_lib.h> | #include <espeak-ng/speak_lib.h> | ||||
#include "mbrola.h" | |||||
#include "error.h" | #include "error.h" | ||||
#include "phoneme.h" | #include "phoneme.h" | ||||
#include "speech.h" | #include "speech.h" |
/* | |||||
* Copyright (C) 2005 to 2015 by Jonathan Duddington | |||||
* email: [email protected] | |||||
* 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: <http://www.gnu.org/licenses/>. | |||||
*/ | |||||
// declarations for compilembrola.c and synth_mbrola.c | |||||
#ifndef ESPEAK_NG_MBROLA_H | |||||
#define ESPEAK_NG_MBROLA_H | |||||
#include <stdbool.h> | |||||
#include "synthesize.h" | |||||
#ifdef __cplusplus | |||||
extern "C" | |||||
{ | |||||
#endif | |||||
typedef struct { | |||||
int name; | |||||
unsigned int next_phoneme; | |||||
int mbr_name; | |||||
int mbr_name2; | |||||
int percent; // percentage length of first component | |||||
int control; | |||||
} MBROLA_TAB; | |||||
extern int mbrola_delay; | |||||
extern char mbrola_name[20]; | |||||
espeak_ng_STATUS LoadMbrolaTable(const char *mbrola_voice, | |||||
const char *phtrans, | |||||
int *srate); | |||||
int MbrolaGenerate(PHONEME_LIST *phoneme_list, | |||||
int *n_ph, bool resume); | |||||
int MbrolaFill(int length, | |||||
bool resume, | |||||
int amplitude); | |||||
void MbrolaReset(void); | |||||
int MbrolaTranslate(PHONEME_LIST *plist, int n_phonemes, bool resume, FILE *f_mbrola); | |||||
#ifdef __cplusplus | |||||
} | |||||
#endif | |||||
#endif | |||||
#include <espeak-ng/encoding.h> | #include <espeak-ng/encoding.h> | ||||
#include "dictionary.h" | #include "dictionary.h" | ||||
#include "mbrola.h" | |||||
#include "readclause.h" | #include "readclause.h" | ||||
#include "synthdata.h" | #include "synthdata.h" | ||||
#include "wavegen.h" | #include "wavegen.h" |
#include <espeak-ng/espeak_ng.h> | #include <espeak-ng/espeak_ng.h> | ||||
#include "mbrola.h" | |||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
extern "C" | extern "C" | ||||
{ | { |
#include <espeak-ng/encoding.h> | #include <espeak-ng/encoding.h> | ||||
#include "dictionary.h" | #include "dictionary.h" | ||||
#include "mbrola.h" | |||||
#include "readclause.h" | #include "readclause.h" | ||||
#include "synthdata.h" | #include "synthdata.h" | ||||
#include "wavegen.h" | #include "wavegen.h" | ||||
#include "speech.h" | #include "speech.h" | ||||
#include "phoneme.h" | #include "phoneme.h" | ||||
#include "voice.h" | #include "voice.h" | ||||
#include "synthesize.h" | #include "synthesize.h" | ||||
#include "translate.h" | #include "translate.h" | ||||
// included here so tests can find these even without OPT_MBROLA set | |||||
int mbrola_delay; | |||||
char mbrola_name[20]; | |||||
#ifdef INCLUDE_MBROLA | #ifdef INCLUDE_MBROLA | ||||
extern int Read4Bytes(FILE *f); | |||||
extern unsigned char *outbuf; | extern unsigned char *outbuf; | ||||
#if defined(_WIN32) || defined(_WIN64) | #if defined(_WIN32) || defined(_WIN64) |
#include "dictionary.h" | #include "dictionary.h" | ||||
#include "intonation.h" | #include "intonation.h" | ||||
#include "mbrola.h" | |||||
#include "setlengths.h" | #include "setlengths.h" | ||||
#include "synthdata.h" | #include "synthdata.h" | ||||
#include "wavegen.h" | #include "wavegen.h" | ||||
int n_phoneme_list = 0; | int n_phoneme_list = 0; | ||||
PHONEME_LIST phoneme_list[N_PHONEME_LIST+1]; | PHONEME_LIST phoneme_list[N_PHONEME_LIST+1]; | ||||
int mbrola_delay; | |||||
char mbrola_name[20]; | |||||
SPEED_FACTORS speed; | SPEED_FACTORS speed; | ||||
static int last_pitch_cmd; | static int last_pitch_cmd; |
char *filename; | char *filename; | ||||
} SOUND_ICON; | } SOUND_ICON; | ||||
typedef struct { | |||||
int name; | |||||
unsigned int next_phoneme; | |||||
int mbr_name; | |||||
int mbr_name2; | |||||
int percent; // percentage length of first component | |||||
int control; | |||||
} MBROLA_TAB; | |||||
typedef struct { | typedef struct { | ||||
int pause_factor; | int pause_factor; | ||||
int clause_pause_factor; | int clause_pause_factor; | ||||
extern int echo_amp; | extern int echo_amp; | ||||
extern short echo_buf[N_ECHO_BUF]; | extern short echo_buf[N_ECHO_BUF]; | ||||
extern int mbrola_delay; | |||||
extern char mbrola_name[20]; | |||||
void SynthesizeInit(void); | void SynthesizeInit(void); | ||||
int Generate(PHONEME_LIST *phoneme_list, int *n_ph, bool resume); | int Generate(PHONEME_LIST *phoneme_list, int *n_ph, bool resume); | ||||
void MakeWave2(PHONEME_LIST *p, int n_ph); | void MakeWave2(PHONEME_LIST *p, int n_ph); | ||||
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 LoadMbrolaTable(const char *mbrola_voice, const char *phtrans, int *srate); | |||||
espeak_ng_STATUS SetParameter(int parameter, int value, int relative); | espeak_ng_STATUS SetParameter(int parameter, int value, int relative); | ||||
int MbrolaTranslate(PHONEME_LIST *plist, int n_phonemes, bool resume, FILE *f_mbrola); | |||||
int MbrolaGenerate(PHONEME_LIST *phoneme_list, int *n_ph, bool resume); | |||||
int MbrolaFill(int length, bool resume, int amplitude); | |||||
void MbrolaReset(void); | |||||
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); |