1.45.44 -- from the espeak and espeakedit zip file sources

This commit is contained in:
Reece Dunn
2011-09-17 16:31:41 +01:00
parent d928de911d
commit f0cf914a15
553 changed files with 12274 additions and 169 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
CC = gcc
CFLAGS += -g -Wall
CFLAGS += -g3 -Wall -O0
all: espeak-phoneme-data
-4
View File
@@ -16,7 +16,3 @@ the phoneme data. If it is not present here, find it in the espeak-data directo
NOTE:
The format of espeak-data/phondata changed in eSpeak version 1.43. The utility
has been modified for this. [jonsd]
---
To contact the author of these utilities, please send an e-mail to
<leonardop@gentoo.org>
+203 -17
View File
@@ -57,12 +57,14 @@ extern void RiscosOpenSound();
extern int WcmdqUsed();
extern void FreePhData();
extern void FreeDictionary();
extern void Write4Bytes(FILE *f, int value);
extern int wcmdq_head;
extern int wcmdq_tail;
extern int current_source_index;
FILE *f_text;
FILE *f_wave = NULL;
int (* uri_callback)(int, const char *, const char *) = NULL;
int (* phoneme_callback)(const char *) = NULL;
@@ -74,6 +76,7 @@ char textbuffile[L_tmpnam];
int sample_rate_index; // current value
int current_voice_num=0;
int n_voice_files = 0;
int n_voice_variant_files = 0;
// output sound buffer, 2 bytes per sample
static unsigned short SoundBuf[4096];
@@ -82,7 +85,9 @@ static int callback_inhibit = 0;
static int more_text=0;
#define N_VOICE_NAMES 60
static char *voice_names[40];
#define N_VOICE_VARIANT_NAMES 30
static char *voice_names[N_VOICE_NAMES];
static char *voice_variant_names[N_VOICE_VARIANT_NAMES];
#define N_STATIC_BUF 8000
static char static_buf[N_STATIC_BUF];
@@ -108,7 +113,7 @@ static const char *help_text =
"-p <integer>\n"
"\t Pitch adjustment, 0 to 99, default is 50\n"
"-s <integer>\n"
"\t Speed in words per minute 80 to 370, default is 170\n"
"\t Speed in words per minute 80 to 390, default is 170\n"
"-v <voice name>\n"
"\t Use voice file of this name from espeak-data/voices\n"
"-w <wave file name>\n"
@@ -125,9 +130,9 @@ static const char *help_text =
"--punct=\"<characters>\"\n"
"\t Speak the names of punctuation characters during speaking. If\n"
"\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"
"--voices=<language>\n"
"\t List the available voices for the specified language.\n"
"\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";
@@ -167,6 +172,7 @@ int GetFileLength(const char *filename)
void ReadVoiceNames2(char *directory)
{//==================================
int len;
int path_len;
int *type;
char *p;
_kernel_swi_regs regs;
@@ -182,6 +188,8 @@ void ReadVoiceNames2(char *directory)
regs.r[5] = sizeof(buf);
regs.r[6] = 0;
path_len = strlen(directory);
while(regs.r[3] > 0)
{
error = _kernel_swi(0x0c+os_X,&regs,&regs); /* OS_GBPB 10, read directory entries */
@@ -200,11 +208,25 @@ void ReadVoiceNames2(char *directory)
}
else
{
p = Alloc(len+1);
p = (char *)malloc(len+1);
strcpy(p,&buf[20]);
voice_names[n_voice_files++] = p;
if(n_voice_files >= (N_VOICE_NAMES-1))
break;
if(strcmp(&directory[path_len-3],".!v")==0)
{
if(n_voice_variant_files >= (N_VOICE_VARIANT_NAMES-1))
continue;
voice_variant_names[n_voice_variant_files++] = p;
}
else
{
if(n_voice_files >= (N_VOICE_NAMES-1))
continue;
voice_names[n_voice_files++] = p;
if(strcmp(p,"en")==0)
{
voice_names[n_voice_files++] = "en+f2";
}
}
}
}
}
@@ -214,13 +236,15 @@ void ReadVoiceNames()
{//===================
char directory[sizeof(path_home)+10];
for(n_voice_files=0; n_voice_files<N_VOICE_NAMES; n_voice_files++)
voice_names[n_voice_files] = NULL;
n_voice_files = 0;
n_voice_variant_files = 0;
sprintf(directory,"%s.voices",path_home);
ReadVoiceNames2(directory);
voice_names[n_voice_files] = NULL;
voice_variant_names[n_voice_variant_files] = NULL;
}
@@ -272,12 +296,90 @@ void Free(void **ptr)
#endif
static int OpenWaveFile(const char *path, int rate)
//=================================================
{
// Set the length of 0x7fffffff for --stdout
// This will be changed to the correct length for -w (write to file)
static unsigned char wave_hdr[44] = {
'R','I','F','F',0,0,0,0,'W','A','V','E','f','m','t',' ',
0x10,0,0,0,1,0,1,0, 9,0x3d,0,0,0x12,0x7a,0,0,
2,0,0x10,0,'d','a','t','a', 0xff,0xff,0xff,0x7f};
if(path == NULL)
return(2);
if(strcmp(path,"stdout")==0)
f_wave = stdout;
else
f_wave = fopen(path,"wb");
if(f_wave != NULL)
{
fwrite(wave_hdr,1,24,f_wave);
Write4Bytes(f_wave,rate);
Write4Bytes(f_wave,rate * 2);
fwrite(&wave_hdr[32],1,12,f_wave);
return(0);
}
return(1);
} // end of OpenWaveFile
static void CloseWaveFile(int rate)
//=================================
{
unsigned int pos;
if((f_wave == NULL) || (f_wave == stdout))
return;
fflush(f_wave);
pos = ftell(f_wave);
fseek(f_wave,4,SEEK_SET);
Write4Bytes(f_wave,pos - 8);
fseek(f_wave,40,SEEK_SET);
Write4Bytes(f_wave,pos - 44);
fclose(f_wave);
f_wave = NULL;
} // end of CloseWaveFile
void MarkerEvent(int type, unsigned int char_position, int value, unsigned char *out_ptr)
{//======================================================================================
// Do nothing in the command-line version.
} // end of MarkerEvent
static int WavegenFile(void)
{//=========================
int finished;
unsigned char wav_outbuf[1024];
out_ptr = out_start = wav_outbuf;
out_end = wav_outbuf + sizeof(wav_outbuf);
finished = WavegenFill(0);
if(f_wave != NULL)
{
fwrite(wav_outbuf, 1, out_ptr - wav_outbuf, f_wave);
}
return(finished);
} // end of WavegenFile
void FillSoundBuf(int size)
@@ -335,6 +437,7 @@ void speak_text_string(char *data, int terminator, int len, int wait, int voice_
regs.r[1] = (int)module_data;
_kernel_swi(0x5f, &regs, &regs);
option_endpause = 1;
if((voice_num >= 0) && (voice_num != current_voice_num) && (voice_num < N_VOICE_NAMES))
{
@@ -465,7 +568,6 @@ void set_say_options(int reg2, int reg3)
option_linelength = 0;
option_phonemes = 0;
option_waveout = 0;
option_harmonic1 = 8;
option_multibyte = 0; // auto
option_capitals = 0;
option_punctuation = 0;
@@ -477,10 +579,13 @@ void set_say_options(int reg2, int reg3)
void jsd_swi_functions(int *r)
/****************************/
{
espeak_VOICE voice_select;
switch(r[0])
{
case 0: /* major version */
r[0] = 3;
r[0] = 4;
r[1] = 331;
break;
case 1: /* register user */
@@ -499,6 +604,7 @@ void jsd_swi_functions(int *r)
case 5: /* get table of voice names */
r[0] = (int)voice_names;
r[1] = (int)voice_variant_names;
break;
case 6: /* update voice data, r1 = voice_number */
@@ -514,6 +620,15 @@ void jsd_swi_functions(int *r)
// init_voice((char *)r[1]);
break;
case 8:
// list voices, r[1] contains optional language name (or "variant")
voice_select.languages = (char *)r[1];
voice_select.age = 0;
voice_select.gender = 0;
voice_select.name = NULL;
r[0] = (int)espeak_ListVoices(&voice_select);
break;
default:
r[0] = 0;
r[1] = 0;
@@ -629,6 +744,72 @@ void PitchAdjust(int pitch_adjustment)
void DisplayVoices(FILE *f_out, char *language)
{//============================================
int ix;
const char *p;
int len;
int count;
int scores = 0;
const espeak_VOICE *v;
const char *lang_name;
char age_buf[12];
const espeak_VOICE **voices;
espeak_VOICE voice_select;
static char genders[4] = {' ','M','F',' '};
if(language[0] == '=')
{
// display only voices for the specified language, in order of priority
voice_select.languages = &language[1];
voice_select.age = 0;
voice_select.gender = 0;
voice_select.name = NULL;
voices = espeak_ListVoices(&voice_select);
scores = 1;
}
else
{
voices = espeak_ListVoices(NULL);
}
fprintf(f_out,"Pty Language Age/Gender VoiceName File Other Langs\n");
for(ix=0; (v = voices[ix]) != NULL; ix++)
{
count = 0;
p = v->languages;
while(*p != 0)
{
len = strlen(p+1);
lang_name = p+1;
if(v->age == 0)
strcpy(age_buf," ");
else
sprintf(age_buf,"%3d",v->age);
if(count==0)
{
fprintf(f_out,"%2d %-12s%s%c %-17s %-11s ",
p[0],lang_name,age_buf,genders[v->gender],v->name,v->identifier);
}
else
{
fprintf(f_out,"(%s %d)",lang_name,p[0]);
}
count++;
p += len+2;
}
// if(scores)
// fprintf(f_out,"%3d ",v->score);
fputc('\n',f_out);
}
} // end of DisplayVoices
char *param_string(char **argp)
{//============================
char *p;
@@ -686,7 +867,6 @@ void command_line(char *arg_string, int wait)
option_phonemes = 0;
option_waveout = 0;
option_quiet = 0;
option_harmonic1 = 8;
option_multibyte = 0; // auto
option_capitals = 0;
option_punctuation = 0;
@@ -776,7 +956,13 @@ void command_line(char *arg_string, int wait)
strncpy0(command,param_string(&p),sizeof(command));
if(memcmp(command,"compile=",8)==0)
{
CompileDictionary(NULL,&command[8],NULL,NULL);
CompileDictionary(NULL,&command[8],NULL,NULL,0);
return;
}
else
if(memcmp(command,"voices",6)==0)
{
DisplayVoices(stdout,&command[6]);
return;
}
else
@@ -1075,7 +1261,7 @@ void terminate_module(void)
{
RiscosCloseSound();
RemoveCallback();
delete translator;
DeleteTranslator(translator);
FreePhData();
} /* end of terminate_module */
Binary file not shown.
+1 -1
View File
@@ -3,7 +3,7 @@
initialisation-code: user_init
title-string: Speak
help-string: Speak 3.30 Text to Speech (32 bit)
help-string: Speak 3.40 Text to Speech (32 bit)
swi-chunk-base-number: &4ad80
swi-handler-code: swi_handler
+56
View File
@@ -0,0 +1,56 @@
eSpeak is a compact, multi-language, open source
text-to-speech synthesizer.
This version is a SAPI5 compatible Windows speech engine
which should work with screen readers such as Jaws,
NVDA, and Window-Eyes.
There is also a version of eSpeak which can be run as a
command-line program. This is in eSpeak\command-line.
Read docs\commands.html for details.
Voices and Languages
====================
The available Voices can be seen as files in the directory
espeak-edit/voices.
To change which eSpeak Voices are available through
Windows, re-run the installer and specify up to six
Voice files which you want to use.
The tone of a Voice can be modified by adding a variant
name after the Voice name, eg:
pt+f3
The available variants are:
male: +m1 +m2 +m3 +m4 +m5
female: +f1 +f2 +f3 +f4
other effects: +croak +wisper
These variants are defined by text files in
espeak-edit/voices/!v
Updates
=======
The eSpeak project homepage is at:
http://espeak.sourceforge.net/
Comments, corrections, and other feedback and assistance
is sought from native speakers of the various languages
because I've no idea how they are supposed to sound :-)
To make changes to pronunciation rules and exceptions,
or to change the sounds of phonemes, or just to experiment
with speech synthesis, download the "espeakedit" program.
License
=======
This software is licencsed under the GNU General Public License
version3. See file: License.txt.
View File
View File
View File
View File
View File
View File
View File
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

+32
View File
@@ -0,0 +1,32 @@
/////////////////////////////////////////////////////////////////////////////
// Name: samples/samples.rc
// Purpose: a standard Win32 .rc file for the wxWindows samples
// Author: Vadim Zeitlin
// Modified by:
// Created: 04.08.03
// RCS-ID: $Id: sample.rc,v 1.2 2003/08/14 14:08:53 VS Exp $
// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// this minimal resource file is all what is needed for most of the wxWindows
// samples
// note that the icon used by the Explorer (i.e. the programs icon) is the
// first icon in the executable and the icons are sorted both by their order
// (Win9x) and by alphabetically (!) (NT), so put this icon first and give it
// a name starting with "a"
aaaaaaaa ICON "sample.ico"
// this icon is used with wxFrame::SetIcon()
sample ICON "sample.ico"
// set this to 1 if you don't want to use manifest resource (manifest resource
// is needed to enable visual styles on Windows XP - see docs/msw/winxp.txt
// for more information)
#define wxUSE_NO_MANIFEST 0
// this is not always needed but doesn't hurt (except making the executable
// very slightly larger): this file contains the standard icons, cursors, ...
#include "wx/msw/wx.rc"
View File
View File
View File
View File
View File
+1 -5
View File
@@ -2,7 +2,7 @@
[Setup]
AppName=eSpeak
AppVerName=eSpeak version 1.45.05
AppVerName=eSpeak version 1.45.01
AppCopyright=Licensed under GNU General Public License version 3. (See file License.txt for details).
WindowVisible=yes
@@ -145,7 +145,6 @@ begin
$1d: Result := 'sv';
$1f: Result := 'tr';
$21: Result := 'id';
$25: Result := 'et';
$26: Result := 'lv';
$2a: Result := 'vi';
$2b: Result := 'hy';
@@ -154,7 +153,6 @@ begin
$2f: Result := 'mk';
$36: Result := 'af';
$39: Result := 'hi';
//$3a: Result := 'mt';
$41: Result := 'sw';
$49: Result := 'ta';
$4b: Result := 'kn';
@@ -232,7 +230,6 @@ begin
'mk': value := $42f;
'ml': value := $44c;
'mn': value := $450;
'mt': value := $43a;
'ne': value := $461;
'nl': value := $413;
'no': value := $414;
@@ -241,7 +238,6 @@ begin
'ro': value := $418;
'ru': value := $419;
'rw': value := $487;
'si': value := $45b;
'sk': value := $41b;
'sq': value := $41c;
'sr': value := $81a;
+1 -1
View File
@@ -1,7 +1,7 @@
[Setup]
AppName=eSpeakEdit
AppVerName=eSpeakEdit version 1.45.05
AppVerName=eSpeakEdit version 1.45.01
DefaultDirName={pf}\eSpeak
DefaultGroupName=eSpeak
OutputBaseFilename=setup_espeakedit
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
@@ -165,7 +165,7 @@ typedef enum {
#ifdef __cplusplus
extern "C"
#endif
int espeak_Initialize(espeak_AUDIO_OUTPUT output, int buflength, const char *path, int options);
ESPEAK_API int espeak_Initialize(espeak_AUDIO_OUTPUT output, int buflength, const char *path, int options);
/* Must be called before any synthesis functions are called.
output: the audio data can either be played by eSpeak or passed back by the SynthCallback function.
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
+54
View File
@@ -0,0 +1,54 @@
From: http://sourceforge.net/forum/message.php?msg_id=6511989
//===========================================================
RE: ESpeak for Windows Mobile 6?
By: Silas S. Brown (ssb22) - 2009-02-24 10:35
On Ubuntu 8 there is a package called pocketpc-g++.
# apt-get install pocketpc-g++
Then download eSpeak sources, do "cd src", and make the following changes:
[jonsd NOTE: These changes are now included in eSpeak 1.40.13 and later]
1. In readclause.cpp, put #ifndef WINCE and #endif around const int wcslen(const wchar_t *str). This is because we will need the wchar functions but we will NOT need that particular one which is already provided by the WinCE library (I don't know why that one is and the others aren't).
2. In voices.cpp, where it says "dir = opendir(path))", put (char*) before "path" (in WinCE the parameter is not declared as const char* even though it should be, and the cast is needed to get it to compile.)
Now type this command:
make speak CXX=arm-wince-pe-g++ USE_AUDIO="-DNEED_GETOPT -DNEED_WCHAR_FUNCTIONS -DWINCE" LIB_AUDIO=
(there is nothing after the LIB_AUDIO= parameter)
This will give you a binary called "speak" which you can copy to the Windows Mobile device. You will also need to set up an espeak-data directory, and compile the dictsource on the device.
[jonsd NOTE: It's OK to use the espeak-data from the standard eSpeak, you don't need to compile it on the Windows Mobile device.]
Of course the result will not be able to produce any sound, only write it to a file. But that should be good enough for use in other programs, as long as the file does not get too big.
From: http://sourceforge.net/forum/message.php?msg_id=6512189
//===========================================================
By the way, Ubuntu also has a package called pocketpc-cab which can be used to make CAB files that will extract on the PocketPC.
# apt-get install pocketpc-cab
For example, to put src/speak onto /bin, and dictsource/ and espeak-data/ directories onto the root directory of the PocketPC, do:
echo src/speak /bin > espeak-files
find dictsource espeak-data -type f | grep -v /mb | sed -e 's,\(.*\)/[^/]*$,& /\1,' >> espeak-files
pocketpc-cab -p JonD -a eSpeak espeak-files espeak.cab
Then bluetooth espeak.cab across and you're done (except for running it with the right arguments including data path, compiling dictsource, etc). This is more convenient than trying to copy across the individual files if you don't have ActiveSync or whatever. It should also make for a more convenient distribution.
From and email from Silas Brown
//=============================
By default, GNU C++ for PocketPC compiles code to generate a debug trace file; if you want to turn this off, try running this command on the "speak" binary after compiling:
python -c 'd=open("speak","rb").read().replace("/temp/wcetrace.log","/notexist/tracelog") ; open("speak","wb").write(d)'