[1.27] Only keep one primary stress when adding prefixes.

Add stress_rule=4, altepenultimate stress.
Change license to GPL version 3.


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@56 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2007-06-30 12:31:21 +00:00
parent 8ad5946b29
commit 05aeea7858
100 changed files with 2330 additions and 1680 deletions
+11 -8
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005, 2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,12 +13,10 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
@@ -272,6 +270,7 @@ static keywtab_t keywords[] = {
{"f4", 0x300000a},
{"paus", 0x300000b},
{"colr=",0x300000c},
{"amp=", 0x300000d},
{"", -1}
};
@@ -1177,7 +1176,7 @@ void Compile::VowelTransition(int which, unsigned int *trans)
flags |= 1;
break;
case 2:
rms = Range(NextItem(tNUMBER), 2, 0, 63) & 0x3f;
rms = Range(NextItem(tNUMBER), 2, 0, 31) & 0x1f;
flags |= 1;
break;
case 3:
@@ -1219,6 +1218,10 @@ void Compile::VowelTransition(int which, unsigned int *trans)
case 12:
vcolour = NextItem(tNUMBER);
break;
case 13:
rms = (Range(NextItem(tNUMBER), 1, 0, 31) & 0x1f) | 0x20;
flags |= 1;
break;
}
}
trans[0] = len + (rms << 6) + (flags << 12) + 0x80000000;
+25 -17
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005,2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,10 +13,10 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "StdAfx.h"
#include <stdio.h>
@@ -31,7 +31,6 @@
#include "synthesize.h"
#include "translate.h"
#define OPT_PH_COMMON // sort rules by phoneme string, common phoneme string output only once
//#define OPT_FORMAT // format the text and write formatted copy to Log file
//#define OUTPUT_FORMAT
@@ -206,7 +205,7 @@ int compile_line(char *linebuf, char *dict_line, int *hash)
c = *p;
}
if((c == '$') && (step != 1))
if((c == '$') && isalnum(p[1]))
{
/* read keyword parameter */
mnemptr = p;
@@ -902,7 +901,8 @@ static int __cdecl string_sorter(char **a, char **b)
pa += (strlen(pa)+1);
pb += (strlen(pb)+1);
return(strcmp(pa,pb));
} /* end of strcmp2 */
} /* end of string_sorter */
static int __cdecl rgroup_sorter(RGROUP *a, RGROUP *b)
{//===================================================
@@ -1020,7 +1020,7 @@ void print_rule_group(FILE *f_out, int n_rules, char **rules, char *name)
#endif
//#define LIST_GROUP_INFO
void output_rule_group(FILE *f_out, int n_rules, char **rules, char *name)
{//=======================================================================
int ix;
@@ -1031,17 +1031,18 @@ void output_rule_group(FILE *f_out, int n_rules, char **rules, char *name)
char *p2, *p3;
const char *common;
//fprintf(f_log,"Group %2s n=%2d at 0x%x\n",name,n_rules,ftell(f_out));
short nextchar_count[256];
memset(nextchar_count,0,sizeof(nextchar_count));
len_name = strlen(name);
#ifdef OUTPUT_FORMAT
print_rule_group(f_log,n_rules,rules,name);
#endif
// sort the rules in this group by their phoneme string
common = "";
#ifdef OPT_PH_COMMON
qsort((void *)rules,n_rules,sizeof(char *),(int (__cdecl *)(const void *,const void *))string_sorter);
#endif
if(strcmp(name,"9")==0)
len_name = 0; // don't remove characters from numeric match strings
@@ -1053,8 +1054,8 @@ void output_rule_group(FILE *f_out, int n_rules, char **rules, char *name)
p3 = &p[len1];
p2 = p3 + len_name; // remove group name from start of match string
len2 = strlen(p2);
//fprintf(f_log,"%4x %2d len1=%2d %2x %2x %2x %2x len2=%2d %2x %2x %2x %2x %2x %2x %2x\n",
// ftell(f_out),ix,len1,p[0],p[1],p[2],p[3],len2,p3[0],p3[1],p3[2],p3[3],p3[4],p3[5],p3[6]);
nextchar_count[(unsigned char)(p2[0])]++; // the next byte after the group name
if((common[0] != 0) && (strcmp(p,common)==0))
{
@@ -1063,18 +1064,25 @@ void output_rule_group(FILE *f_out, int n_rules, char **rules, char *name)
}
else
{
#ifdef OPT_PH_COMMON
if((ix < n_rules-1) && (strcmp(p,rules[ix+1])==0))
{
common = rules[ix]; // phoneme string is same as next, set as common
fputc(RULE_PH_COMMON,f_out);
}
#endif
fwrite(p2,len2,1,f_out);
fputc(RULE_PHONEMES,f_out);
fwrite(p,len1,1,f_out);
}
}
#ifdef LIST_GROUP_INFO
for(ix=32; ix<256; ix++)
{
if(nextchar_count[ix] > 30)
printf("Group %s %c %d\n",name,ix,nextchar_count[ix]);
}
#endif
} // end of output_rule_group
+21 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005,2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,10 +13,10 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "StdAfx.h"
#define LOG_TRANSLATE
@@ -1082,6 +1082,21 @@ void Translator::SetWordStress(char *output, unsigned int dictionary_flags, int
}
break;
case 4: // stress on antipenultimate vowel
if(stressed_syllable == 0)
{
stressed_syllable = vowel_count - 3;
if(stressed_syllable < 1)
stressed_syllable = 1;
if(max_stress == 0)
{
vowel_stress[stressed_syllable] = 4;
}
max_stress = 4;
}
break;
case 5:
// LANG=Russian
if(stressed_syllable == 0)
+6 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005,2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2006 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,9 +13,8 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include <stdio.h>
@@ -73,6 +72,7 @@ static const char *help_text =
int samplerate;
FILE *f_wavfile = NULL;
char wavefile[160];
+1 -1
View File
@@ -3,7 +3,7 @@
* *
* 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
+10 -9
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005, 2006 by Jonathan Duddington *
* jsd@clara.co.uk *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,9 +13,8 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "wx/wx.h"
@@ -43,7 +42,9 @@
#include "prosodydisplay.h"
static char *about_string = "espeakedit: %s\nAuthor: Jonathan Duddington (c) 2006";
static char *about_string = "espeakedit: %s\nAuthor: Jonathan Duddington (c) 2007\n\n"
"Licensed under GNU General Public License version 3\n"
"http://espeak.sourceforge.net/";
const char *path_data = "/home/jsd1/speechdata/phsource";
@@ -252,7 +253,7 @@ wxSashLayoutWindow *win;
if((result = LoadPhData()) != 1)
{
if(result == -1)
wxLogError(_T("Failed to load phoneme data,\nneeds espeak-data/phontab,phondata,phonindex"));
wxLogError(_T("Failed to load phoneme data,\nneeds espeak-data/phontab,phondata,phonindex\nPath = ")+wxString(path_home,wxConvLocal));
else
wxLogError(_T("Wrong version of espeak-data: 0x%x (expects 0x%x)"),result,version_phdata);
@@ -341,7 +342,7 @@ void MyFrame::OnQuit(wxCommandEvent& event)
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{//===================================================
char buf[120];
char buf[300];
sprintf(buf,about_string,espeak_Info(NULL));
(void)wxMessageBox(wxString(buf,wxConvLocal), _T("About eSpeak Editor"));
+1 -1
View File
@@ -3,7 +3,7 @@
* *
* 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
+7 -7
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2006 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,9 +13,8 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "wx/wx.h"
@@ -1165,6 +1164,7 @@ int x;
}
#endif
char* text1 = "Hello World2. <audio src=\"here\"> Some text</audio> This is the second sentence";
void TestTest(int control)
@@ -1181,7 +1181,7 @@ void TestTest(int control)
//CharsetToUnicode("ISO-8859-4");
//CharsetToUnicode("ISCII");
//return;
return;
if(control==2)
{
+1 -1
View File
@@ -3,7 +3,7 @@
* *
* 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
+6 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005, 2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2006 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,12 +13,12 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wx.h"
#include "wx/mdi.h"
+6 -7
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005, 2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,10 +13,10 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "StdAfx.h"
#include <stdio.h>
@@ -446,7 +446,6 @@ static void set_pitch(int ix, int base, int drop)
{
int pitch1, pitch2;
int flags = 0;
int x;
/* adjust experimentally */
int pitch_range2 = 148;
-10
View File
@@ -1,13 +1,3 @@
/////////////////////////////////////////////////////////////////////////////
// Name: sashtest.h
// Purpose: Layout window/sash sample
// Author: Julian Smart
// Modified by:
// Created: 04/01/98
// RCS-ID: $Id: sashtest.h,v 1.4 2002/03/17 14:15:55 VZ Exp $
// Copyright: (c) Julian Smart
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#include "wx/toolbar.h"
#include "wx/laywin.h"
+1 -1
View File
@@ -9,7 +9,7 @@
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* version 3 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
+5 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005, 2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,9 +13,8 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
+6 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,10 +13,10 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "StdAfx.h"
+6 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005,2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,11 +13,11 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "wx/wx.h"
#include "wx/fileconf.h"
#include "sys/stat.h"
+11 -9
View File
@@ -1,18 +1,20 @@
/***************************************************************************
options.h - description
-------------------
begin : Sat Mar 13 2004
copyright : (C) 2004 by Jonathan Duddington
email : jsd@jsd.clara.co.uk
***************************************************************************/
/***************************************************************************
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 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 see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef OPTIONS_H
+6 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005,2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,12 +13,12 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
// phoneme types
#define phPAUSE 0
#define phSTRESS 1
+6 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2007 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,10 +13,10 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "StdAfx.h"
#include <stdio.h>
+6 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005, 2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,12 +13,12 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "wx/wx.h"
#include "wx/numdlg.h"
+6 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,10 +13,10 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "StdAfx.h"
#include <stdio.h>
+6 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005,2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,10 +13,10 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "StdAfx.h"
#include <stdlib.h>
+14 -19
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005,2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,10 +13,10 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "StdAfx.h"
#include "speech.h"
@@ -84,14 +84,10 @@ static const char *help_text =
"\t =<characters> is omitted, all punctuation is spoken.\n"
"--voices=<langauge>\n"
"\t List the available voices for the specified language.\n"
"\t If <language> is omitted, then list all voices.\n";
#ifdef deleted
"\t If <language> is omitted, then list all voices.\n"
"-k <integer>\n"
"\t Indicate capital letters with: 1=sound, 2=the word \"capitals\",\n"
"\t higher values = a pitch increase (try -k20).\n";
#endif
void DisplayVoices(FILE *f_out, char *language);
@@ -245,14 +241,13 @@ static void init_path(void)
sprintf(path_home,"%s\\espeak-data",buf);
#else
char *env;
if((env = getenv("ESPEAK-DATA-PATH")) != NULL)
{
snprintf(path_home,sizeof(path_home),"%s/espeak-data",env);
if(GetFileLength(path_home) == -2)
return; // an espeak-data directory exists
}
// char *env;
// if((env = getenv("ESPEAK-DATA-PATH")) != NULL)
// {
// snprintf(path_home,sizeof(path_home),"%s/espeak-data",env);
// if(GetFileLength(path_home) == -2)
// return; // an espeak-data directory exists
// }
snprintf(path_home,sizeof(path_home),"%s/espeak-data",getenv("HOME"));
if(access(path_home,R_OK) != 0)
+13 -13
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005,2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,10 +13,10 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "StdAfx.h"
#include "stdio.h"
@@ -292,7 +292,7 @@ static void init_path(const char *path)
return;
}
if((env = getenv("espeak-path")) != NULL)
if((env = getenv("ESPEAK-DATA-PATH")) != NULL)
{
sprintf(path_home,"%s/espeak-data",env);
if(GetFileLength(path_home) == -2)
@@ -316,12 +316,12 @@ static void init_path(const char *path)
return;
}
if((env = getenv("ESPEAK-DATA-PATH")) != NULL)
{
snprintf(path_home,sizeof(path_home),"%s/espeak-data",env);
if(GetFileLength(path_home) == -2)
return; // an espeak-data directory exists
}
// if((env = getenv("ESPEAK-DATA-PATH")) != NULL)
// {
// snprintf(path_home,sizeof(path_home),"%s/espeak-data",env);
// if(GetFileLength(path_home) == -2)
// return; // an espeak-data directory exists
// }
snprintf(path_home,sizeof(path_home),"%s/espeak-data",getenv("HOME"));
if(access(path_home,R_OK) != 0)
+5 -6
View File
@@ -1,12 +1,12 @@
#ifndef SPEAK_LIB_H
#define SPEAK_LIB_H
/***************************************************************************
* Copyright (C) 2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -15,9 +15,8 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
+18 -19
View File
@@ -1,23 +1,22 @@
/**************************************************************************
* Copyright (C) 2005,2006 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. *
***************************************************************************/
/***************************************************************************
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 3 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 see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#define USE_MODULE
+5 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005,2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,9 +13,8 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
+19
View File
@@ -1,3 +1,22 @@
/***************************************************************************
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 3 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 see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "wx/spinctrl.h"
#include "wx/notebook.h"
+5 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005,2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,9 +13,8 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
+6 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005,2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,11 +13,11 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "wx/wx.h"
#include <math.h>
+6 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005,2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,11 +13,11 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include <sys/types.h>
// conditional compilation options
+6 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2007 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,10 +13,10 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "StdAfx.h"
#include <stdio.h>
+9 -9
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005,2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,13 +13,13 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "StdAfx.h"
#include "StdAfx.h"
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
@@ -35,8 +35,8 @@
#include "translate.h"
#include "wave.h"
const char *version_string = "1.26.11 26.Jun.07";
const int version_phdata = 0x012601;
const char *version_string = "1.27 30.Jun.07";
const int version_phdata = 0x012701;
int option_device_number = -1;
+40 -20
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005,2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,10 +13,10 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "StdAfx.h"
#include <stdio.h>
@@ -325,18 +325,24 @@ static void set_frame_rms(frame_t *fr, int new_rms)
int h;
int ix;
static const short sqrt_tab[100] = {
0, 64, 90,110,128,143,156,169,181,192,202,212,221,230,239,247,
256,263,271,278,286,293,300,306,313,320,326,332,338,344,350,356,
362,367,373,378,384,389,394,399,404,409,414,419,424,429,434,438,
443,448,452,457,461,465,470,474,478,483,487,491,495,499,503,507,
512,515,519,523,527,531,535,539,543,546,550,554,557,561,565,568,
572,576,579,583,586,590,593,596,600,603,607,610,613,617,620,623,
627,630,633,636 };
static const short sqrt_tab[200] = {
0, 64, 90,110,128,143,156,169,181,192,202,212,221,230,239,247,
256,263,271,278,286,293,300,306,313,320,326,332,338,344,350,356,
362,367,373,378,384,389,394,399,404,409,414,419,424,429,434,438,
443,448,452,457,461,465,470,474,478,483,487,491,495,499,503,507,
512,515,519,523,527,531,535,539,543,546,550,554,557,561,565,568,
572,576,579,583,586,590,593,596,600,603,607,610,613,617,620,623,
627,630,633,636,640,643,646,649,652,655,658,662,665,668,671,674,
677,680,683,686,689,692,695,698,701,704,706,709,712,715,718,721,
724,726,729,732,735,738,740,743,746,749,751,754,757,759,762,765,
768,770,773,775,778,781,783,786,789,791,794,796,799,801,804,807,
809,812,814,817,819,822,824,827,829,832,834,836,839,841,844,846,
849,851,853,856,858,861,863,865,868,870,872,875,877,879,882,884,
886,889,891,893,896,898,900,902};
if(fr->rms == 0) return; // check for divide by zero
x = (new_rms * 64)/fr->rms;
if(x >= 100) x = 99;
if(x >= 200) x = 199;
x = sqrt_tab[x]; // sqrt(new_rms/fr->rms)*0x200;
@@ -464,6 +470,7 @@ int FormantTransition2(frameref_t *seq, int &n_frames, unsigned int data1, unsig
{//==============================================================================================================================
int ix;
int formant;
int next_rms;
int len;
int rms;
@@ -489,7 +496,7 @@ static short vcolouring[N_VCOLOUR][5] = {
return(0);
len = (data1 & 0x3f) * 2;
rms = ((data1 >> 6) & 0x3f) * 2;
rms = (data1 >> 6) & 0x3f;
flags = (data1 >> 12);
f2 = (data2 & 0x3f) * 50;
@@ -517,26 +524,39 @@ static short vcolouring[N_VCOLOUR][5] = {
seq[0].frflags |= FRFLAG_LEN_MOD; // reduce length modification
fr->frflags |= FRFLAG_LEN_MOD;
next_rms = seq[1].frame->rms;
if(f2 != 0)
{
if(rms & 0x20)
{
set_frame_rms(fr,(next_rms * (rms & 0x1f))/30);
}
AdjustFormants(fr, f2, f2_min, f2_max, f1, f3_adj, f3_amp, flags);
set_frame_rms(fr,rms);
if((rms & 0x20) == 0)
{
set_frame_rms(fr,rms*2);
}
}
else
{
set_frame_rms(fr,RMS_START);
if(flags & 8)
set_frame_rms(fr,(next_rms*24)/32);
else
set_frame_rms(fr,RMS_START);
}
if(flags & 8)
{
set_frame_rms(fr,seq[1].frame->rms - 5);
// set_frame_rms(fr,next_rms - 5);
modn_flags = 0x800 + (VowelCloseness(fr) << 8);
}
}
else
{
// exit from vowel
rms = rms*2;
if((f2 != 0) || (flags != 0))
{
+6 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005,2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,11 +13,11 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#define N_PHONEME_LIST 700 // enough for source[] full of text, else it will truncate
#define MAX_HARMONIC 400 // 400 * 50Hz = 20 kHz, more than enough
+6 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005,2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,10 +13,10 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "StdAfx.h"
#include <stdio.h>
+28 -10
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005,2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,10 +13,10 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "StdAfx.h"
#include <stdio.h>
@@ -226,7 +226,7 @@ Translator *SelectTranslator(const char *name)
case L('f','r'): // french
{
static int stress_lengths_fr[8] = {180, 160, 180, 190, 0, 0, 220, 220};
static int stress_lengths_fr[8] = {190, 170, 190, 200, 0, 0, 235, 235};
static int stress_amps_fr[8] = {16,14, 20,20, 20,24, 24,22 };
tr = new Translator();
@@ -379,10 +379,10 @@ Translator *SelectTranslator(const char *name)
tr->langopts.unstressed_wd1 = 2;
tr->langopts.unstressed_wd2 = 2;
tr->langopts.param[LOPT_IT_LENGTHEN] = 2; // remove lengthen indicator from unstressed or non-penultimate syllables
// tr->langopts.param[LOPT_IT_DOUBLING] = 2;
tr->langopts.param[LOPT_IT_DOUBLING] = 2; // double the first consonant if the previous word ends in a stressed vowel
tr->langopts.param[LOPT_SONORANT_MIN] = 130; // limit the shortening of sonorants before short vowels
tr->langopts.param[LOPT_REDUCE] = 1; // reduce vowels even if phonemes are specified in it_list
tr->langopts.numbers = 0x2709;
tr->langopts.numbers = 0x2709 + 0x800;
}
break;
@@ -391,13 +391,31 @@ Translator *SelectTranslator(const char *name)
tr = new Translator();
tr->charset_a0 = charsets[4]; // ISO-8859-4, includes a,e,i,o,u-macron
tr->langopts.stress_rule = 2;
tr->langopts.stress_flags = 0x21;
tr->langopts.stress_flags = 0x20;
tr->langopts.unstressed_wd1 = 0;
tr->langopts.unstressed_wd2 = 2;
tr->langopts.param[LOPT_DIERESES] = 1;
}
break;
case L('m','k'): // Macedonian
{
static wchar_t vowels_cyrillic[] = {0x430,0x435,0x438,0x439,0x43e,0x443,0x44b,0x44d,0x44e,0x44f,0x450,0x451,0x456,0x457,0x45d,0x45e,0};
static int stress_amps_mk[8] = {16,16, 20,20, 20,24, 24,22 };
static int stress_lengths_mk[8] = {180,160, 200,200, 0,0, 220,230};
tr = new Translator();
SetupTranslator(tr,stress_lengths_mk,stress_amps_mk);
tr->charset_a0 = charsets[2]; // ISO-8859-2
tr->letter_groups[0] = vowels_cyrillic;
tr->langopts.stress_rule = 4; // antipenultimate
tr->langopts.numbers = 0x0c29 + 0x84000;
tr->langopts.numbers2 = 0xa; // variant numbers before thousands,milliards
}
break;
case L('n','l'): // Dutch
{
static const int stress_lengths_nl[8] = {160,135, 210,210, 0, 0, 260,280};
+6 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005,2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,14 +13,14 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
class Translator_English: public Translator
{//=======================================
+29 -10
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005, 2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,10 +13,10 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "StdAfx.h"
#include <stdio.h>
@@ -922,8 +922,22 @@ strcpy(phonemes2,phonemes);
{
if((langopts.param[LOPT_PREFIXES]) || (prefix_type & SUFX_T))
{
char *p;
// German, keep a secondary stress on the stem
SetWordStress(phonemes,dictionary_flags,3,0);
// reduce all but the first primary stress
ix=0;
for(p=prefix_phonemes; *p != 0; p++)
{
if(*p == phonSTRESS_P)
{
if(ix==0)
ix=1;
else
*p = phonSTRESS_3;
}
}
strcpy(word_phonemes,prefix_phonemes);
strcat(word_phonemes,phonemes);
SetWordStress(word_phonemes,dictionary_flags,-1,0);
@@ -1421,7 +1435,8 @@ int Translator::TranslateWord2(char *word, WORD_TAB *wtab, int pre_pause, int ne
{
if(first_phoneme && langopts.param[LOPT_IT_DOUBLING])
{
if((prev_dict_flags & FLAG_DOUBLING) || (end_stressed_vowel && (langopts.param[LOPT_IT_DOUBLING] == 2)))
if(((prev_dict_flags & FLAG_DOUBLING) && (langopts.param[LOPT_IT_DOUBLING] & 1)) ||
(end_stressed_vowel && (langopts.param[LOPT_IT_DOUBLING] & 2)))
{
// italian, double the initial consonant if the previous word ends with a
// stressed vowel, or is marked with a flag
@@ -1534,7 +1549,7 @@ int Translator::TranslateChar(char *ptr, int prev_in, int c, int next_in, int *i
// To allow language specific examination and replacement of characters
const wchar_t *p;
unsigned int new_c;
unsigned int new_c, c2;
int upper_case = 0;
if(c == 0) return(0);
@@ -1555,8 +1570,12 @@ int Translator::TranslateChar(char *ptr, int prev_in, int c, int next_in, int *i
new_c = langopts.replacement_chars[p - langopts.replace_chars];
if(new_c & 0xffe00000)
{
// there is a second character to be inserted (don't convert the case of the second character)
*insert = (new_c >> 16);
// there is a second character to be inserted
// don't convert the case of the second character unless the next letter is also upper case
c2 = new_c >> 16;
if(upper_case && iswupper(next_in))
c2 = towupper(c2);
*insert = c2;
new_c &= 0xffff;
}
#ifndef PLATFORM_RISCOS
+7 -7
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005,2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,11 +13,11 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#define L(c1,c2) (c1<<8)+c2 // combine two characters into an integer for translator name
#define CTRL_EMBEDDED 0x01 // control character at the start of an embedded command
@@ -290,7 +290,7 @@ typedef struct {
// bits13-15 post-decimal-digits 0=single digits, 1=(LANG=it) 2=(LANG=pl) 3=(LANG=ro)
// bit16=dot after number indicates ordinal
// bit18=special word for 100,000s LANG=sw
// bit19=(LANG=pl)
// bit19=(LANG=pl) two forms of plural, M or MA
int numbers;
+6 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005,2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,12 +13,12 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "wx/wx.h"
+6 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,12 +13,12 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
typedef struct {
char name[40];
+6 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005, 2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,11 +13,11 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "wx/wx.h"
+13 -13
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,10 +13,10 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "StdAfx.h"
#include "stdio.h"
@@ -684,12 +684,12 @@ voice_t *LoadVoice(const char *vname, int control)
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;
// 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 = double(pitch1 - 82)/82;
voice->formant_factor = (int)((1+factor/4) * 256); // nominal formant shift for a different voice pitch
}
break;
@@ -807,7 +807,7 @@ voice_t *LoadVoice(const char *vname, int control)
voice->breath[0] = Read8Numbers(p,&voice->breath[1]);
for(ix=1; ix<8; ix++)
{
if(ix & 1)
if(ix % 2)
voice->breath[ix] = -voice->breath[ix];
}
break;
+6 -6
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005,2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,11 +13,11 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include <math.h>
#include "wx/wx.h"
#include <wx/dcmemory.h>
+1 -1
View File
@@ -4,7 +4,7 @@
* *
* 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
+9 -10
View File
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (C) 2005, 2006 by Jonathan Duddington *
* jonsd@users.sourceforge.net *
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: 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 *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@@ -13,10 +13,10 @@
* 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. *
* along with this program; if not, write see: *
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "StdAfx.h"
// this version keeps wavemult window as a constant fraction
@@ -1050,8 +1050,6 @@ void SetBreath()
} // end of SetBreath
#define getrandom(min,max) ((rand()%(int)(((max)+1)-(min)))+(min))
int ApplyBreath(void)
{//==================
int noise;
@@ -1059,13 +1057,14 @@ int ApplyBreath(void)
int amp;
int value = 0;
noise = getrandom(-4095,4095);
// use two random numbers, for alternate formants
noise = (rand() & 0x3fff) - 0x2000;
for(ix=1; ix < N_PEAKS; ix++)
{
if((amp = wvoice->breath[ix]) != 0)
{
amp *= (peaks[ix].height >> 13);
amp *= (peaks[ix].height >> 14);
value += int(resonator(&rbreath[ix],noise) * amp);
}
}