[1.47.04]

Official release

git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@337 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2013-04-02 13:18:57 +00:00
parent 394869c5c2
commit e5cc887ce5
18 changed files with 452 additions and 127 deletions
+5 -6
View File
@@ -2,8 +2,8 @@
# Toolflags:
CCflags = -c -C90 -depend !Depend -IC: -throwback -zM
C++flags = -c -depend !Depend -IC: -throwback -zM
CCflags = -c -C90 -depend !Depend -IC: -throwback -memaccess -zM -L22-S22-L41
C++flags = -c -depend !Depend -IC: -throwback -zM -L22-S22-L41
Linkflags = -rmf -c++ -o $@
ObjAsmflags = -throwback -NoCache -depend !Depend
CMHGflags =
@@ -16,11 +16,11 @@ Squeezeflags = -o $@
@.o.intonation @.o.readclause @.o.setlengths @.o.synthdata \
@.o.synthesize @.o.translate @.o.tr_languages @.o.numbers \
@.o.synth_mbrola @.o.phonemelist \
@.o.tr_english @.o.wavegen @.o.voices @.o.assemb @.o.cmhgfile
@.o.wavegen @.o.voices @.o.assemb @.o.cmhgfile
Link $(Linkflags) C:o.stubs C:o.c++lib @.o.speak_riscos @.o.compiledict \
@.o.dictionary @.o.intonation @.o.readclause @.o.setlengths \
@.o.synthdata @.o.synthesize @.o.numbers @.o.synth_mbrola \
@.o.translate @.o.tr_english @.o.wavegen @.o.tr_languages \
@.o.translate @.o.wavegen @.o.tr_languages \
@.o.voices @.o.phonemelist @.o.assemb @.o.cmhgfile
@@ -51,8 +51,6 @@ Squeezeflags = -o $@
c++ $(c++flags) -o @.o.synthesize @.CPP.synthesize
@.o.translate: @.CPP.translate
c++ $(c++flags) -o @.o.translate @.CPP.translate
@.o.tr_english: @.CPP.tr_english
c++ $(c++flags) -o @.o.tr_english @.CPP.tr_english
@.o.tr_languages: @.CPP.tr_languages
c++ $(c++flags) -o @.o.tr_languages @.CPP.tr_languages
@.o.voices: @.CPP.voices
@@ -63,3 +61,4 @@ Squeezeflags = -o $@
objasm $(objasmflags) -from @.s.assemb -to @.o.assemb
# Dynamic dependencies:
-1
View File
@@ -18,6 +18,5 @@ copy <obey$dir>.^.src.sintab/h <obey$dir>.h.sintab fq~c
copy <obey$dir>.^.src.speak_lib/h <obey$dir>.h.speak_lib fq~c
copy <obey$dir>.^.src.synthesize/h <obey$dir>.h.synthesize fq~c
copy <obey$dir>.^.src.translate/h <obey$dir>.h.translate fq~c
copy <obey$dir>.^.src.tr_languages/h <obey$dir>.h.tr_languages fq~c
copy <obey$dir>.^.src.voice/h <obey$dir>.h.voice fq~c
copy <obey$dir>.^.src.wave/h <obey$dir>.h.wave fq~c
+111 -25
View File
@@ -1,6 +1,6 @@
/***************************************************************************
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* Copyright (C) 2005 to 2013 by Jonathan Duddington *
* email: jonsd@users.sourceforge.net *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -26,6 +26,7 @@
#include <ctype.h>
#include <locale.h>
#include "kernel.h"
#include <math.h>
#include "speech.h"
#include "speak_lib.h"
@@ -221,6 +222,7 @@ void ReadVoiceNames2(char *directory)
voice_variant_names[n_voice_variant_files++] = p;
}
else
if(strcmp(p, "default") != 0)
{
if(n_voice_files >= (N_VOICE_NAMES-1))
continue;
@@ -233,11 +235,17 @@ void ReadVoiceNames2(char *directory)
void ReadVoiceNames()
{//===================
char directory[sizeof(path_home)+10];
char directory[sizeof(path_home)+20];
n_voice_files = 0;
n_voice_variant_files = 0;
sprintf(directory,"%s.voices.default", path_home);
if(GetFileLength(directory) > 0)
{
// put the 'default' voice at the start of the list
voice_names[n_voice_files++] = "default";
}
sprintf(directory,"%s.voices",path_home);
ReadVoiceNames2(directory);
@@ -400,11 +408,27 @@ void FillSoundBuf(int size)
int initialise(void)
{//=================
sprintf(path_home,"%s.espeak-data","<eSpeak$Dir>");
char buf[N_PATH_HOME];
_kernel_swi_regs regs;
_kernel_oserror *error;
buf[0] = 0;
regs.r[0] = (int)"eSpeak$Dir";
regs.r[1] = (int)buf;
regs.r[2] = sizeof(buf);
regs.r[3] = 0;
regs.r[4] = 0;
regs.r[5] = 0;
error = _kernel_swi(0x20023,&regs,&regs); // OS_ReadVarVal
buf[regs.r[2]] = 0;
sprintf(path_home,"%s.espeak-data",buf);
if(GetFileLength(path_home) != -2)
{
// not found, try the 10 character version of the directory name
sprintf(path_home,"%s.espeak-dat","<eSpeak$Dir>");
sprintf(path_home,"%s.espeak-dat",buf);
}
if(GetFileLength(path_home) != -2)
{
@@ -414,7 +438,7 @@ int initialise(void)
}
WavegenInit(22050,0);
LoadPhData();
LoadPhData(NULL);
SetVoiceStack(NULL, "");
SynthesizeInit();
return(0);
@@ -453,7 +477,7 @@ void speak_text_string(char *data, int terminator, int len, int wait, int voice_
static_length = 0;
else
{
strcat(&static_buf[static_length]," : ");
strcat(&static_buf[static_length]," \n ");
static_length+=3;
}
@@ -578,13 +602,14 @@ void set_say_options(int reg2, int reg3)
void jsd_swi_functions(int *r)
/****************************/
{
int use_ipa;
espeak_VOICE voice_select;
switch(r[0])
{
case 0: /* major version */
r[0] = 4;
r[1] = 331;
r[1] = 347;
break;
case 1: /* register user */
@@ -594,7 +619,13 @@ void jsd_swi_functions(int *r)
break;
case 3:
// r[0] = (int)speech_to_phonemes((char *)r[1]);
// translate into phonemes
use_ipa = 0;
if((r[2] >= 1) && (use_ipa <= 3))
use_ipa = r[2];
TranslateClause(translator,NULL,(char *)r[1],NULL,NULL);
GetTranslatedPhonemeString(translator->phon_out, sizeof(translator->phon_out), use_ipa);
r[0] = (int)translator->phon_out;
break;
case 4:
@@ -642,6 +673,7 @@ _kernel_oserror *swi_handler(int swi_no, int *r, void *pw)
/*********************************************************/
{
int value;
int value2;
int q_length;
value = r[0];
@@ -650,21 +682,23 @@ _kernel_oserror *swi_handler(int swi_no, int *r, void *pw)
case 0: // ready ?
// returns the index into the source text of the currently speaking word
if(current_source_index > 0)
r[1] = current_source_index-1;
else
r[1] = current_source_index; /* source index */
if(current_source_index > 0)
r[1] = current_source_index-1;
else
r[1] = current_source_index; /* source index */
r[2] = 0; /* source tag */
r[3] = 0; /* for future expansion */
r[4] = 0;
r[5] = 0;
if(wcmdq_head == wcmdq_tail)
if(WcmdqUsed() < 5)
{
r[0] = -1; /* ready, or nearly */
}
else
{
r[0] = 0;
}
break;
case 1: /* restore old sound channel. DO NOTHING */
@@ -692,19 +726,32 @@ _kernel_oserror *swi_handler(int swi_no, int *r, void *pw)
break;
case 7: /* pitch */
// not implemented
value = (value * 50)/128;
SetParameter(espeakPITCH, value, 0);
break;
case 8: /* speed */
SetParameter(espeakRATE,value,0);
case 8: // speed, convert to range 80 to 400, mid-value=180
if(value < 128)
value2 = 80 + (value*100)/128; // linear range for 0-127 -> 80-179
else
value2 = 80 + pow((float)value/128.0, 1.75)*100;
SetParameter(espeakRATE,value2,0);
break;
case 9: /* word_gap */
if(value >= 128)
value = value - 128;
if(value > 1)
value = (value-1) * 5;
SetParameter(espeakWORDGAP,value,0);
break;
case 10: /* pitch_range */
// not implemented
value = (value * 50)/128;
SetParameter(espeakRANGE, value, 0);
break;
case 12: /* reset */
@@ -712,7 +759,22 @@ _kernel_oserror *swi_handler(int swi_no, int *r, void *pw)
break;
case 13: /* volume */
SetParameter(espeakVOLUME,value,0);
// convert to range 6-255 to 10-400, mid-value=100
if(value < 6)
value2 = value + 4;
else
if(value < 128)
{
value2 = pow((float)(value+40)/168.0, 1.75)*100;
}
else
value2 = pow((float)value/128.0, 2.0)*100;
SetParameter(espeakVOLUME,value2,0);
WavegenSetVoice(voice);
break;
case 14: // set voice by name
SetVoiceByName((char *)r[0]);
WavegenSetVoice(voice);
break;
}
@@ -835,6 +897,13 @@ int param_number(char **argp)
return(value);
}
void PrintVersion()
{//================
char buf[120];
printf("\nspeak text-to-speech: %s Data at: %s\n", version_string, path_home);
}
void command_line(char *arg_string, int wait)
{//==========================================
@@ -854,6 +923,7 @@ void command_line(char *arg_string, int wait)
char command[80];
char *p;
int ix;
int quiet;
voicename[0] = 0;
wavefile[0] = 0;
@@ -861,7 +931,7 @@ void command_line(char *arg_string, int wait)
option_linelength = 0;
option_phonemes = 0;
option_waveout = 0;
option_quiet = 0;
quiet = 0;
option_multibyte = 0; // auto
option_capitals = 0;
option_punctuation = 0;
@@ -887,7 +957,8 @@ void command_line(char *arg_string, int wait)
break;
case 'h':
printf("\nspeak text-to-speech: %s\n%s",version_string,help_text);
PrintVersion();
printf("\n%s",help_text);
return;
case 'k':
@@ -912,7 +983,7 @@ void command_line(char *arg_string, int wait)
break;
case 'q':
option_quiet = 1;
quiet = 1;
break;
case 'f':
@@ -963,7 +1034,8 @@ void command_line(char *arg_string, int wait)
else
if(strcmp(command,"help")==0)
{
printf("\nspeak text-to-speech: %s\n%s",version_string,help_text);
PrintVersion();
printf("\n%s",help_text);
return;
}
else
@@ -980,6 +1052,17 @@ void command_line(char *arg_string, int wait)
SetParameter(espeakPUNCTUATION,option_punctuation,0);
}
else
if(memcmp(command,"version",7)==0)
{
PrintVersion();
return;
}
else
if(memcmp(command,"ipa",3)==0)
{
option_phonemes = 3;
}
else
{
printf("Command not recognised\n");
}
@@ -997,22 +1080,25 @@ void command_line(char *arg_string, int wait)
}
}
if((option_phonemes > 1) && !option_waveout)
quiet = 1; // can't call sprintf() during callback
SetVoiceByName(voicename);
if((filename[0]==0) && (p[0]=='\r'))
{
// nothing to speak
if(option_quiet)
if(quiet)
{
SpeakNextClause(NULL,NULL,2); // stop speaking
more_text = 0;
}
}
if(option_waveout || option_quiet)
if(option_waveout || quiet)
{
// write speech to a WAV file
if(option_quiet)
if(quiet)
{
OpenWaveFile(NULL,samplerate);
option_waveout = 2;
+5 -3
View File
@@ -2,7 +2,7 @@
[Setup]
AppName=eSpeak
AppVerName=eSpeak version 1.47.03
AppVerName=eSpeak version 1.47.04
AppCopyright=Licensed under GNU General Public License version 3. (See file License.txt for details).
WindowVisible=yes
@@ -146,7 +146,7 @@ begin
$0e: Result := 'hu';
$0f: Result := 'is';
$10: Result := 'it';
//$12: Result := 'ko';
$12: Result := 'ko';
$13: Result := 'nl';
$14: Result := 'no';
$15: Result := 'pl';
@@ -158,7 +158,7 @@ begin
$1c: Result := 'sq';
$1d: Result := 'sv';
$1f: Result := 'tr';
//$20: Result := 'ur';
$20: Result := 'ur';
$21: Result := 'id';
$25: Result := 'et';
$26: Result := 'lv';
@@ -174,6 +174,7 @@ begin
$39: Result := 'hi';
//$3a: Result := 'mt';
$3c: Result := 'ga';
$3e: Result := 'ms';
//$3f: Result := 'kk';
$41: Result := 'sw';
//$44: Result := 'tt';
@@ -263,6 +264,7 @@ begin
'mk': value := $42f;
'ml': value := $44c;
'mn': value := $450;
'ms': value := $43e;
'mt': value := $43a;
'my': value := $455;
'ne': value := $461;
+1 -1
View File
@@ -1,7 +1,7 @@
[Setup]
AppName=eSpeakEdit
AppVerName=eSpeakEdit version 1.47.03
AppVerName=eSpeakEdit version 1.47.04
DefaultDirName={pf}\eSpeak
DefaultGroupName=eSpeak
OutputBaseFilename=setup_espeakedit