[1.39.28]

Added experimental Klatt synthesizer.
Klatt phonemes use a new format of phoneme data.
espeakedit, new dialog fields and layout for Klatt phonemes.
Added Klatt versions of English phonemes.

Fixed some compilation warnings on Windows.
Fixed bug in Lettergroups > L10

Increased amplitude of harmonics below F1 peak, to increase bass.
Allow 5 (up from 4) pairs of values in "tone" command in voice files.
Default to slightly wider pk_shape1.

If words are separated by hyphens, don't add word-gap, and don't pass new-word flag onto phoneme processing.


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@203 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2008-11-22 22:25:29 +00:00
parent a7501374b2
commit 1150d1d8da
52 changed files with 2687 additions and 399 deletions
+66 -7
View File
@@ -22,11 +22,13 @@
#define MAX_HARMONIC 400 // 400 * 50Hz = 20 kHz, more than enough
#define N_SEQ_FRAMES 25 // max frames in a spectrum sequence (real max is ablut 8)
#define STEPSIZE 64 // 2.9mS at 22 kHz sample rate
#define PITCHfall 0
#define PITCHrise 1
// flags set for frames within a spectrum sequence
#define FRFLAG_KLATT 0x01 // this frame includes extra data for Klatt synthesizer
#define FRFLAG_VOWEL_CENTRE 0x02 // centre point of vowel
#define FRFLAG_LEN_MOD 0x04 // reduce effect of length adjustment
#define FRFLAG_BREAK_LF 0x08 // but keep f3 upwards
@@ -75,6 +77,18 @@ typedef struct {
short pkright;
} peak_t;
#define N_KLATTP 10 // this affects the phoneme data file format
#define KLATT_AV 0
#define KLATT_Kopen 1
#define KLATT_Skew 2
#define KLATT_Tilt 3
#define KLATT_Turb 4
#define KLATT_Aspr 5
#define KLATT_AVp 6 // this is after the parameters which can be change by the Voice
#define KLATT_Fric 7
#define KLATT_FricBP 8
#define KLATT_spare1 9
typedef struct {
short frflags;
unsigned char length;
@@ -83,8 +97,20 @@ typedef struct {
unsigned char fheight[9];
unsigned char fwidth[6]; // width/4
unsigned char fright[6]; // width/4
unsigned char fwidth6, fright6;
unsigned char klattp[N_KLATTP];
} frame_t;
typedef struct {
short frflags;
unsigned char length;
unsigned char rms;
short ffreq[9];
unsigned char fheight[9];
unsigned char fwidth[6]; // width/4
unsigned char fright[6]; // width/4
} frame_t2; // the original, without Klatt additions, used for file "phondata"
// formant data used by wavegen
@@ -103,6 +129,26 @@ typedef struct {
DOUBLEX right_inc;
} wavegen_peaks_t;
typedef struct {
unsigned char *pitch_env;
int pitch; // pitch Hz*256
int pitch_ix; // index into pitch envelope (*256)
int pitch_inc; // increment to pitch_ix
int pitch_base; // Hz*256 low, before modified by envelope
int pitch_range; // Hz*256 range of envelope
unsigned char *mix_wavefile; // wave file to be added to synthesis
int n_mix_wavefile; // length in bytes
int mix_wave_scale; // 0=2 byte samples
int mix_wave_amp;
int mix_wavefile_ix;
int amplitude;
int amplitude_v;
int prev_was_synth; // previous sound was synthesized (not a played wave or pause)
} WGEN_DATA;
typedef struct {
double a;
double b;
@@ -113,11 +159,19 @@ typedef struct {
typedef struct {
short length;
short length_total; // not used
unsigned char n_frames;
unsigned char flags;
frame_t2 frame[N_SEQ_FRAMES]; // max. frames in a spectrum sequence
} SPECT_SEQ; // sequence of espeak formant frames
typedef struct {
short length_total; // not used
unsigned char n_frames;
unsigned char flags;
frame_t frame[N_SEQ_FRAMES]; // max. frames in a spectrum sequence
} SPECT_SEQ;
} SPECT_SEQK; // sequence of klatt formants frames
typedef struct {
short length;
@@ -176,16 +230,18 @@ extern unsigned char env_frise[128];
extern unsigned char pitch_adjust_tab[MAX_PITCH_VALUE+1];
// queue of commands for wavegen
#define WCMD_AMPLITUDE 1
#define WCMD_PITCH 2
#define WCMD_KLATT 1
#define WCMD_KLATT2 2
#define WCMD_SPECT 3
#define WCMD_SPECT2 4
#define WCMD_PAUSE 5
#define WCMD_WAVE 6
#define WCMD_WAVE2 7
#define WCMD_MARKER 8
#define WCMD_VOICE 9
#define WCMD_EMBEDDED 10
#define WCMD_AMPLITUDE 8
#define WCMD_PITCH 9
#define WCMD_MARKER 10
#define WCMD_VOICE 11
#define WCMD_EMBEDDED 12
#define N_WCMDQ 160
@@ -278,3 +334,6 @@ int PauseLength(int pause, int control);
int LookupPhonemeTable(const char *name);
void InitBreath(void);
void KlattInit();
int Wavegen_Klatt2(int length, int modulation, int resume, frame_t *fr1, frame_t *fr2);