1 /*************************************************************************** 2 * Copyright 1991, 1992, 1993, 1994, 1995, 1996, 2001, 2002 * 3 * David R. Hill, Leonard Manzara, Craig Schock * 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, see <http://www.gnu.org/licenses/>. * 17 ***************************************************************************/ 18 // 2014-10 19 // This file was copied from Gnuspeech and modified by Marcelo Y. Matuda. 20 21 #ifndef TRM_CONFIGURATION_H_ 22 #define TRM_CONFIGURATION_H_ 23 24 #include "Tube.h" 25 26 #include <string> 27 28 29 30 namespace GS { 31 namespace TRM { 32 33 struct Configuration { 34 Configuration(); 35 36 void load(const std::string& configFilePath, const std::string& voiceFilePath); 37 38 double outputRate; /* output sample rate (22.05, 44.1) */ 39 40 double volume; /* master volume (0 - 60 dB) */ 41 int channels; /* # of sound output channels (1, 2) */ 42 double balance; /* stereo balance (-1 to +1) */ 43 44 int waveform; /* GS waveform type (0=PULSE, 1=SINE */ 45 46 double vtlOffset; /* tube length offset */ 47 double temperature; /* tube temperature (25 - 40 C) */ 48 double lossFactor; /* junction loss factor in (0 - 5 %) */ 49 50 double mouthCoef; /* mouth aperture coefficient */ 51 double noseCoef; /* nose aperture coefficient */ 52 53 double throatCutoff; /* throat lp cutoff (50 - nyquist Hz) */ 54 double throatVol; /* throat volume (0 - 48 dB) */ 55 56 int modulation; /* pulse mod. of noise (0=OFF, 1=ON) */ 57 double mixOffset; /* noise crossmix offset (30 - 60 dB) */ 58 59 // Parameters that depend on the voice. 60 double glottalPulseTp; /* % glottal pulse rise time */ 61 double glottalPulseTnMin; /* % glottal pulse fall time minimum */ 62 double glottalPulseTnMax; /* % glottal pulse fall time maximum */ 63 double breathiness; /* % glottal source breathiness */ 64 double vocalTractLength; 65 double referenceGlottalPitch; 66 double apertureRadius; /* aperture scl. radius (3.05 - 12 cm) */ 67 double noseRadius[Tube::TOTAL_NASAL_SECTIONS]; /* fixed nose radii (0 - 3 cm) */ 68 double radiusCoef[Tube::TOTAL_REGIONS]; 69 }; 70 71 } /* namespace TRM */ 72 } /* namespace GS */ 73 74 #endif /* TRM_CONFIGURATION_H_ */ 75