[1.26.11] Windows: look for environment variable ESPEAK-DATA-PATH for the directory which contains the espeak-data directory.

AdjustFormants(): adjust the F2 target by a factor which depends on the voice pitch.


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@55 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2007-06-26 11:00:24 +00:00
parent 5414063759
commit 8ad5946b29
17 changed files with 188 additions and 176 deletions
-55
View File
@@ -1,55 +0,0 @@
/***************************************************************************
* Copyright (C) 2004 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef _VOICEEDIT_H_
#define _VOICEEDIT_H_
/**
* @short Application Main Window
* @author Jonathan Duddington <jsd@clara.co.uk>
* @version 0.1
*/
class
voiceeditapp : public wxApp
{
public:
virtual bool OnInit();
};
class
voiceeditFrame : public wxFrame
{
public:
voiceeditFrame( const wxString& title, const wxPoint& pos, const wxSize& pos );
void OnQuit( wxCommandEvent& event );
void OnAbout( wxCommandEvent& event );
private:
DECLARE_EVENT_TABLE()
};
enum
{
Menu_File_Quit = 100,
Menu_File_About
};
#endif // _VOICEEDIT_H_
+1 -1
View File
@@ -35,7 +35,7 @@
#include "translate.h"
#include "wave.h"
const char *version_string = "1.26.10 23.Jun.07";
const char *version_string = "1.26.11 26.Jun.07";
const int version_phdata = 0x012601;
int option_device_number = -1;
+2
View File
@@ -403,6 +403,8 @@ static void AdjustFormants(frame_t *fr, int target, int min, int max, int f1_adj
//hf_reduce = 70; // ?? using fixed amount rather than the parameter??
target = (target * voice->formant_factor)/256;
x = (target - fr->ffreq[2]) / 2;
if(x > max) x = max;
if(x < min) x = min;
+2 -1
View File
@@ -36,7 +36,8 @@ typedef struct {
int echo_amp;
int n_harmonic_peaks; // highest formant which is formed from adding harmonics
int peak_shape; // alternative shape for formant peaks (0=standard 1=squarer)
int voicing; // 100% = 64, level of formant-synthesized sound
int voicing; // 100% = 64, level of formant-synthesized sound
int formant_factor; // adjust nominal formant frequencies by this because of the voice's pitch (256ths)
// parameters used by Wavegen
int freq[N_PEAKS]; // 100% = 256
+6
View File
@@ -366,6 +366,7 @@ void VoiceReset(int tone_only)
// default is: pitch 82,118
voice->pitch_base = 0x49000; // default, 73 << 12;
voice->pitch_range = 0x0f30; // default = 0x1000
voice->formant_factor = 256;
voice->echo_delay = 0;
voice->echo_amp = 0;
@@ -681,10 +682,15 @@ voice_t *LoadVoice(const char *vname, int control)
break;
case V_PITCH:
{
double factor;
// default is pitch 82 118
n = sscanf(p,"%d %d",&pitch1,&pitch2);
voice->pitch_base = (pitch1 - 9) << 12;
voice->pitch_range = (pitch2 - pitch1) * 108;
factor = float(pitch1 - 82)/82;
voice->formant_factor = (1+factor/4) * 256;
}
break;
case V_STRESSLENGTH: // stressLength
+2
View File
@@ -1110,6 +1110,8 @@ static int Wavegen()
hswitch = 0;
harmspect = hspect[0];
maxh2 = PeaksToHarmspect(peaks,pitch<<4,hspect[0],0);
// adjust amplitude to compensate for fewer harmonics at higher pitch
amplitude2 = (amplitude * pitch)/(100 << 12);
// switch sign of harmonics above about 900Hz, to reduce max peak amplitude