mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-21 11:31:00 +00:00
Merge branch 'master' into build
This commit is contained in:
@@ -2,11 +2,13 @@
|
||||
|
||||
|
||||
// 13.02.10 jonsd: Changed for eSpeak version 1.43
|
||||
// 13.08.10 jonsd: Added Q lines. Use Address to set the displacement in phondata file.
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN
|
||||
@@ -101,6 +103,7 @@ void swap_phontab (const char *infile, const char *outfile);
|
||||
|
||||
void usage (const char *program_name);
|
||||
|
||||
int xread; // prevent compiler warning from fread()
|
||||
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
@@ -181,6 +184,7 @@ void swap_phondata (const char *infile, const char *outfile,
|
||||
const char *manifest)
|
||||
{//==========================================================
|
||||
FILE *in, *mfest, *out;
|
||||
int displ;
|
||||
char line[1024];
|
||||
unsigned char buf_4[4];
|
||||
|
||||
@@ -202,24 +206,30 @@ void swap_phondata (const char *infile, const char *outfile,
|
||||
exit (1);
|
||||
}
|
||||
|
||||
fread (buf_4, 4, 1, in);
|
||||
fwrite (buf_4, 4, 1, out);
|
||||
xread = fread(buf_4, 4, 1, in);
|
||||
fwrite(buf_4, 4, 1, out);
|
||||
|
||||
while (fgets (line, sizeof(line), mfest))
|
||||
{
|
||||
if(!isupper(line[0])) continue;
|
||||
|
||||
sscanf(&line[2],"%x",&displ);
|
||||
fseek(in, displ, SEEK_SET);
|
||||
|
||||
while (fgets (line, 1024, mfest)) {
|
||||
if (line[0] == 'S') {
|
||||
SPECT_SEQ buf_spect;
|
||||
size_t ix;
|
||||
int n;
|
||||
|
||||
fread (&buf_spect.length, 2, 1, in);
|
||||
fread (&buf_spect.n_frames, 1, 1, in);
|
||||
xread = fread (&buf_spect.length, 2, 1, in);
|
||||
xread = fread (&buf_spect.n_frames, 1, 1, in);
|
||||
fseek (in, -3, SEEK_CUR);
|
||||
|
||||
ix = (char *)(&buf_spect.frame[buf_spect.n_frames]) -
|
||||
(char *)(&buf_spect);
|
||||
ix = (ix+3) & 0xfffc;
|
||||
|
||||
fread (&buf_spect, ix, 1, in);
|
||||
xread = fread (&buf_spect, ix, 1, in);
|
||||
|
||||
buf_spect.length = (short) SWAP_USHORT (buf_spect.length);
|
||||
for (n = 0; n < buf_spect.n_frames; n++) {
|
||||
@@ -242,7 +252,7 @@ void swap_phondata (const char *infile, const char *outfile,
|
||||
int length;
|
||||
char *wave_data;
|
||||
|
||||
fread (buf_4, 4, 1, in);
|
||||
xread = fread (buf_4, 4, 1, in);
|
||||
fwrite (buf_4, 4, 1, out);
|
||||
|
||||
length = buf_4[1] * 256 + buf_4[0];
|
||||
@@ -253,7 +263,7 @@ void swap_phondata (const char *infile, const char *outfile,
|
||||
exit (1);
|
||||
}
|
||||
|
||||
fread (wave_data, 1, length, in);
|
||||
xread = fread (wave_data, 1, length, in);
|
||||
fwrite (wave_data, 1, length, out);
|
||||
|
||||
pos = ftell (in);
|
||||
@@ -273,7 +283,7 @@ void swap_phondata (const char *infile, const char *outfile,
|
||||
else if (line[0] == 'E') {
|
||||
char env_buf[128];
|
||||
|
||||
fread (env_buf, 1, 128, in);
|
||||
xread = fread (env_buf, 1, 128, in);
|
||||
fwrite (env_buf, 1, 128, out);
|
||||
}
|
||||
}
|
||||
@@ -302,7 +312,7 @@ void swap_phonindex (const char *infile, const char *outfile)
|
||||
exit (1);
|
||||
}
|
||||
|
||||
fread (buf_4, 4, 1, in); // skip first 4 bytes
|
||||
xread = fread (buf_4, 4, 1, in); // skip first 4 bytes
|
||||
fwrite(buf_4, 4, 1, out);
|
||||
|
||||
while (! feof (in)) {
|
||||
@@ -339,7 +349,7 @@ void swap_phontab (const char *infile, const char *outfile)
|
||||
exit (1);
|
||||
}
|
||||
|
||||
fread (buf_8, 4, 1, in);
|
||||
xread = fread (buf_8, 4, 1, in);
|
||||
fwrite (buf_8, 4, 1, out);
|
||||
n_phoneme_tables = buf_8[0];
|
||||
|
||||
@@ -347,18 +357,18 @@ void swap_phontab (const char *infile, const char *outfile)
|
||||
int n_phonemes, j;
|
||||
char tab_name[N_PHONEME_TAB_NAME];
|
||||
|
||||
fread (buf_8, 8, 1, in);
|
||||
xread = fread (buf_8, 8, 1, in);
|
||||
fwrite (buf_8, 8, 1, out);
|
||||
|
||||
n_phonemes = buf_8[0];
|
||||
|
||||
fread (tab_name, N_PHONEME_TAB_NAME, 1, in);
|
||||
xread = fread (tab_name, N_PHONEME_TAB_NAME, 1, in);
|
||||
fwrite (tab_name, N_PHONEME_TAB_NAME, 1, out);
|
||||
|
||||
for (j = 0; j < n_phonemes; j++) {
|
||||
PHONEME_TAB table;
|
||||
|
||||
fread (&table, sizeof (PHONEME_TAB), 1, in);
|
||||
xread = fread (&table, sizeof (PHONEME_TAB), 1, in);
|
||||
|
||||
table.mnemonic = SWAP_UINT (table.mnemonic);
|
||||
table.phflags = SWAP_UINT (table.phflags);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
[Setup]
|
||||
AppName=eSpeak
|
||||
AppVerName=eSpeak version 1.43.24
|
||||
AppVerName=eSpeak version 1.44.01
|
||||
AppCopyright=Licensed under GNU General Public License version 3. (See file License.txt for details).
|
||||
WindowVisible=yes
|
||||
|
||||
@@ -32,7 +32,6 @@ Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme
|
||||
Source: "License.txt"; DestDir: "{app}";
|
||||
|
||||
[Registry]
|
||||
;Root: HKLM; Subkey: "Software\Microsoft\Speech\Voices\Tokens\eSpeak_5"; Flags: deletekey uninsdeletekey
|
||||
Root: HKLM; Subkey: "Software\Microsoft\Speech\PhoneConverters\Tokens\eSpeak"; Flags: deletekey uninsdeletekey
|
||||
|
||||
|
||||
@@ -111,8 +110,10 @@ begin
|
||||
lang_main := language and $3ff;
|
||||
Result := 'en';
|
||||
|
||||
// translation from microsoft codes to language codes
|
||||
// Translation from microsoft codes to language codes
|
||||
// Used to set default voices for inatallation.
|
||||
case lang_main of
|
||||
//$02: Result := 'bg';
|
||||
$03: Result := 'ca';
|
||||
$04: Result := 'zh';
|
||||
$05: Result := 'cs';
|
||||
@@ -126,7 +127,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';
|
||||
@@ -142,17 +143,18 @@ begin
|
||||
$26: Result := 'lv';
|
||||
$2a: Result := 'vi';
|
||||
$2b: Result := 'hy';
|
||||
$2d: Result := 'eu';
|
||||
//$2c: Result := 'az';
|
||||
//$2d: Result := 'eu';
|
||||
$2f: Result := 'mk';
|
||||
$36: Result := 'af';
|
||||
$39: Result := 'hi';
|
||||
$41: Result := 'sw';
|
||||
$49: Result := 'ta';
|
||||
$4b: Result := 'kn';
|
||||
$50: Result := 'mn';
|
||||
//$4b: Result := 'kn';
|
||||
//$50: Result := 'mn';
|
||||
$52: Result := 'cy';
|
||||
$61: Result := 'ne';
|
||||
$87: Result := 'rw';
|
||||
//$61: Result := 'ne';
|
||||
//$87: Result := 'rw';
|
||||
end;
|
||||
|
||||
// is there a match on the full language code?
|
||||
@@ -185,8 +187,12 @@ begin
|
||||
lang1 := Copy(voice,8,6); // eg. mb-de4-en, return 'en'
|
||||
end;
|
||||
|
||||
// Used to set the correct Microsoft language code in the registry
|
||||
// when a SAPI5 voice is installed.
|
||||
case lang1 of
|
||||
'af': value := $436;
|
||||
'az': value := $42c;
|
||||
'bg': value := $402;
|
||||
'bs': value := $41a; // should be $141a but Jaws crashes on startup
|
||||
'ca': value := $403;
|
||||
'cs': value := $405;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
[Setup]
|
||||
AppName=eSpeakEdit
|
||||
AppVerName=eSpeakEdit version 1.43.24
|
||||
AppVerName=eSpeakEdit version 1.44.01
|
||||
DefaultDirName={pf}\eSpeak
|
||||
DefaultGroupName=eSpeak
|
||||
OutputBaseFilename=setup_espeakedit
|
||||
@@ -14,6 +14,9 @@ ShowLanguageDialog=auto
|
||||
Name: "{group}\espeakedit"; Filename: "{app}\espeakedit.exe"; WorkingDir: "{app}"; Flags: runmaximized
|
||||
Name: "{group}\Uninstall espeakedit"; Filename: "{uninstallexe}"
|
||||
|
||||
[InstallDelete]
|
||||
Type: filesandordirs; Name: "{app}\phsource\vowelcharts"
|
||||
|
||||
|
||||
[Files]
|
||||
Source: "espeakedit.exe"; DestDir: "{app}"
|
||||
|
||||
@@ -178,6 +178,7 @@ int SynthCallback(short *wav, int numsamples, espeak_EVENT *events)
|
||||
// return the events
|
||||
for(event=events; (event->type != 0) && (n_Events < N_EVENTS); event++)
|
||||
{
|
||||
|
||||
audio_latest = event->audio_position + audio_offset;
|
||||
|
||||
if((event->type == espeakEVENT_WORD) && (event->length > 0))
|
||||
@@ -260,8 +261,8 @@ static int ConvertRate(int new_rate)
|
||||
|
||||
int rate;
|
||||
|
||||
static int rate_table[21] = {80,100,115,124,133,142,151,159,168,174,180,
|
||||
187,196,208,220,240,270,300,335,369,390 };
|
||||
static int rate_table[21] = {80,110,124,133,142,151,159,168,174,180,187,
|
||||
196,208,220,240,270,300,335,369,390,450 };
|
||||
|
||||
rate = new_rate + master_rate;
|
||||
if(rate < -10) rate = -10;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,42,00
|
||||
PRODUCTVERSION 1,0,42,00
|
||||
FILEVERSION 1,0,44,00
|
||||
PRODUCTVERSION 1,0,44,00
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -24,14 +24,14 @@ BEGIN
|
||||
VALUE "Comments", "\0"
|
||||
VALUE "CompanyName", "Jonathan Duddington\0"
|
||||
VALUE "FileDescription", "Text to Speech\0"
|
||||
VALUE "FileVersion", "1, 0,42,00\0"
|
||||
VALUE "InternalName", "espeak1.42\0"
|
||||
VALUE "FileVersion", "1, 0,44,00\0"
|
||||
VALUE "InternalName", "espeak1.44\0"
|
||||
VALUE "LegalCopyright", "Copyright (c) Jonathan Duddington\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "espeak_sapi.dll\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "espeak TTS\0"
|
||||
VALUE "ProductVersion", "1, 0, 42, 00\0"
|
||||
VALUE "ProductVersion", "1, 0, 44, 00\0"
|
||||
VALUE "SpecialBuild", "\0"
|
||||
END
|
||||
END
|
||||
|
||||
Reference in New Issue
Block a user