Navit SVN

/work/compile/navit/src/navit/support/espeak/voice.h

00001 /***************************************************************************
00002  *   Copyright (C) 2005 to 2007 by Jonathan Duddington                     *
00003  *   email: jonsd@users.sourceforge.net                                    *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 3 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write see:                           *
00017  *               <http://www.gnu.org/licenses/>.                           *
00018  ***************************************************************************/
00019 
00020 
00021 
00022 typedef struct {
00023         char v_name[40];
00024 
00025         int phoneme_tab_ix;  // phoneme table number
00026         int pitch_base;    // Hz<<12
00027         int pitch_range;   // standard = 0x1000
00028         
00029         int speedf1;
00030         int speedf2;
00031         int speedf3;
00032 
00033         int flutter;
00034         int roughness;
00035         int echo_delay;
00036         int echo_amp;
00037         int n_harmonic_peaks;  // highest formant which is formed from adding harmonics
00038         int peak_shape;        // alternative shape for formant peaks (0=standard 1=squarer)
00039         int voicing;           // 100% = 64, level of formant-synthesized sound
00040         int formant_factor;      // adjust nominal formant frequencies by this  because of the voice's pitch (256ths)
00041         int consonant_amp;     // amplitude of unvoiced consonants
00042         int consonant_ampv;    // amplitude of the noise component of voiced consonants
00043         int klattv[8];
00044 
00045         // parameters used by Wavegen
00046         short freq[N_PEAKS];    // 100% = 256
00047         short height[N_PEAKS];  // 100% = 256
00048         short width[N_PEAKS];   // 100% = 256
00049         short freqadd[N_PEAKS];  // Hz
00050 
00051         // copies without temporary adjustments from embedded commands
00052         short freq2[N_PEAKS];    // 100% = 256
00053         short height2[N_PEAKS];  // 100% = 256
00054         short width2[N_PEAKS];   // 100% = 256
00055 
00056         int breath[N_PEAKS];  // amount of breath for each formant. breath[0] indicates whether any are set.
00057         int breathw[N_PEAKS];  // width of each breath formant
00058 
00059         // This table provides the opportunity for tone control.
00060         // Adjustment of harmonic amplitudes, steps of 8Hz
00061         // value of 128 means no change
00062         #define N_TONE_ADJUST  1000
00063         unsigned char tone_adjust[N_TONE_ADJUST];   //  8Hz steps * 1000 = 8kHz
00064 
00065 } voice_t;
00066 
00067 // percentages shown to user, ix=N_PEAKS means ALL peaks
00068 extern USHORT voice_pcnt[N_PEAKS+1][3];
00069 
00070 
00071 extern voice_t *voice;
00072 extern int tone_points[12];
00073 
00074 const char *SelectVoice(espeak_VOICE *voice_select, int *found);
00075 espeak_VOICE *SelectVoiceByName(espeak_VOICE **voices, const char *name);
00076 voice_t *LoadVoice(const char *voice_name, int control);
00077 voice_t *LoadVoiceVariant(const char *voice_name, int variant);
00078 void DoVoiceChange(voice_t *v);
00079 void WavegenSetVoice(voice_t *v);
00080 void ReadTonePoints(char *string, int *tone_pts);
00081