1 /***************************************************************************
2  *   Copyright (C) 2005 to 2007 by Jonathan Duddington                     *
3  *   email: jonsd@users.sourceforge.net                                    *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 3 of the License, or     *
8  *   (at your option) any later version.                                   *
9  *                                                                         *
10  *   This program is distributed in the hope that it will be useful,       *
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13  *   GNU General Public License for more details.                          *
14  *                                                                         *
15  *   You should have received a copy of the GNU General Public License     *
16  *   along with this program; if not, write see:                           *
17  *               <http://www.gnu.org/licenses/>.                           *
18  ***************************************************************************/
19 
20 
21 
22 typedef struct {
23 	char v_name[40];
24 	char language_name[20];
25 
26 	int phoneme_tab_ix;  // phoneme table number
27 	int pitch_base;    // Hz<<12
28 	int pitch_range;   // standard = 0x1000
29 
30 	int speedf1;
31 	int speedf2;
32 	int speedf3;
33 
34 	int speed_percent;      // adjust the WPM speed by this percentage
35 	int flutter;
36 	int roughness;
37 	int echo_delay;
38 	int echo_amp;
39 	int n_harmonic_peaks;  // highest formant which is formed from adding harmonics
40 	int peak_shape;        // alternative shape for formant peaks (0=standard 1=squarer)
41 	int voicing;           // 100% = 64, level of formant-synthesized sound
42 	int formant_factor;      // adjust nominal formant frequencies by this  because of the voice's pitch (256ths)
43 	int consonant_amp;     // amplitude of unvoiced consonants
44 	int consonant_ampv;    // amplitude of the noise component of voiced consonants
45 	int samplerate;
46 	int klattv[8];
47 
48 	// parameters used by Wavegen
49 	short freq[N_PEAKS];    // 100% = 256
50 	short height[N_PEAKS];  // 100% = 256
51 	short width[N_PEAKS];   // 100% = 256
52 	short freqadd[N_PEAKS];  // Hz
53 
54 	// copies without temporary adjustments from embedded commands
55 	short freq2[N_PEAKS];    // 100% = 256
56 	short height2[N_PEAKS];  // 100% = 256
57 	short width2[N_PEAKS];   // 100% = 256
58 
59 	int breath[N_PEAKS];  // amount of breath for each formant. breath[0] indicates whether any are set.
60 	int breathw[N_PEAKS];  // width of each breath formant
61 
62 	// This table provides the opportunity for tone control.
63 	// Adjustment of harmonic amplitudes, steps of 8Hz
64 	// value of 128 means no change
65 	#define N_TONE_ADJUST  1000
66 	unsigned char tone_adjust[N_TONE_ADJUST];   //  8Hz steps * 1000 = 8kHz
67 
68 } voice_t;
69 
70 // percentages shown to user, ix=N_PEAKS means ALL peaks
71 extern USHORT voice_pcnt[N_PEAKS+1][3];
72 
73 extern espeak_VOICE current_voice_selected;
74 
75 extern voice_t *voice;
76 extern int tone_points[12];
77 
78 const char *SelectVoice(espeak_VOICE *voice_select, int *found);
79 espeak_VOICE *SelectVoiceByName(espeak_VOICE **voices, const char *name);
80 voice_t *LoadVoice(const char *voice_name, int control);
81 voice_t *LoadVoiceVariant(const char *voice_name, int variant);
82 void DoVoiceChange(voice_t *v);
83 void WVoiceChanged(voice_t *wvoice);
84 void WavegenSetVoice(voice_t *v);
85 void ReadTonePoints(char *string, int *tone_pts);
86 void VoiceReset(int control);
87 
88