PageRenderTime 18ms CodeModel.GetById 1ms app.highlight 13ms RepoModel.GetById 1ms app.codeStats 0ms

/native/external/espeak/src/voice.h

http://eyes-free.googlecode.com/
C++ Header | 80 lines | 40 code | 16 blank | 24 comment | 0 complexity | 4656a4bf805fde226509610c660275e2 MD5 | raw file
 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
22typedef struct {
23	char v_name[40];
24
25	int phoneme_tab_ix;  // phoneme table number
26	int pitch_base;    // Hz<<12
27	int pitch_range;   // standard = 0x1000
28	
29	int speedf1;
30	int speedf2;
31	int speedf3;
32
33	int flutter;
34	int roughness;
35	int echo_delay;
36	int echo_amp;
37	int n_harmonic_peaks;  // highest formant which is formed from adding harmonics
38	int peak_shape;        // alternative shape for formant peaks (0=standard 1=squarer)
39	int voicing;           // 100% = 64, level of formant-synthesized sound
40	int formant_factor;      // adjust nominal formant frequencies by this  because of the voice's pitch (256ths)
41	int consonant_amp;     // amplitude of unvoiced consonants
42	int consonant_ampv;    // amplitude of the noise component of voiced consonants
43
44	// parameters used by Wavegen
45	short freq[N_PEAKS];    // 100% = 256
46	short height[N_PEAKS];  // 100% = 256
47	short width[N_PEAKS];   // 100% = 256
48	short freqadd[N_PEAKS];  // Hz
49
50	// copies without temporary adjustments from embedded commands
51	short freq2[N_PEAKS];    // 100% = 256
52	short height2[N_PEAKS];  // 100% = 256
53	short width2[N_PEAKS];   // 100% = 256
54
55	int breath[N_PEAKS];  // amount of breath for each formant. breath[0] indicates whether any are set.
56	int breathw[N_PEAKS];  // width of each breath formant
57
58	// This table provides the opportunity for tone control.
59	// Adjustment of harmonic amplitudes, steps of 8Hz
60	// value of 128 means no change
61	#define N_TONE_ADJUST  1000
62	unsigned char tone_adjust[N_TONE_ADJUST];   //  8Hz steps * 1000 = 8kHz
63
64} voice_t;
65
66// percentages shown to user, ix=N_PEAKS means ALL peaks
67extern USHORT voice_pcnt[N_PEAKS+1][3];
68
69
70extern voice_t *voice;
71extern int tone_points[10];
72
73const char *SelectVoice(espeak_VOICE *voice_select);
74espeak_VOICE *SelectVoiceByName(espeak_VOICE **voices, const char *name);
75voice_t *LoadVoice(const char *voice_name, int control);
76voice_t *LoadVoiceVariant(const char *voice_name, int variant);
77void DoVoiceChange(voice_t *v);
78void WavegenSetVoice(voice_t *v);
79void ReadTonePoints(char *string, int *tone_pts);
80