mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-26 04:59:59 +00:00
Lang=fr change to phonemes [o] [O] [A~] [O~] [R]
Added new phonemes [s.] and [z.] (as common phonemes), use in Lang=ru, Lang=sv, Lang=hi Remake WAV files for [s;] and [z;] phonemes. espeak_Terminate(), set pointers to NULL after free(). espeak_Initialize(), returns EE_INTERNAL_ERROR (-1) if fails to allocate memory. Change to the default tone setting (array: tone_points in voices.cpp). git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@5 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+2
-2
@@ -1098,9 +1098,9 @@ void Translator::SetWordStress(char *output, unsigned int dictionary_flags, int
|
||||
|
||||
if((langopts.stress_flags & 0x1000) && (vowel_stress[1] == 0))
|
||||
{
|
||||
if((vowel_count == 3) && (vowel_stress[2] >= 4))
|
||||
// If there is only one syllable before the primary stress, give it a secondary stress
|
||||
if((vowel_count > 2) && (vowel_stress[2] >= 4))
|
||||
{
|
||||
// 2-syllable word, put a secondary stress on the initial syllable
|
||||
vowel_stress[1] = 3;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -267,7 +267,7 @@ static TONE_TABLE tone_table[N_TONE_TABLE] = {
|
||||
{PITCHfrise, 38,10, PITCHfrise2, 36,10, // comma, or question
|
||||
20, 25, 34, 20, drops_0, 3, 3, 15, 25, 0},
|
||||
|
||||
{PITCHdrop, 40, 2, PITCHdrop, 42,25, // exclamation
|
||||
{PITCHdrop, 38, 1, PITCHdrop, 42,25, // exclamation
|
||||
20, 25, 34, 22, drops_0, 3, 3, 12, 8, 0},
|
||||
|
||||
|
||||
|
||||
+5
-2
@@ -1841,8 +1841,11 @@ void InitText2(void)
|
||||
ssml_sp->voice_variant = 0;
|
||||
ssml_sp->voice_gender = 0;
|
||||
ssml_sp->voice_age = 0;
|
||||
strncpy0(ssml_sp->voice_name,pvoice->name,sizeof(ssml_sp->voice_name));
|
||||
strncpy0(ssml_sp->language,&pvoice->languages[1],sizeof(ssml_sp->language));
|
||||
if(pvoice != NULL)
|
||||
{
|
||||
strncpy0(ssml_sp->voice_name,pvoice->name,sizeof(ssml_sp->voice_name));
|
||||
strncpy0(ssml_sp->language,&pvoice->languages[1],sizeof(ssml_sp->language));
|
||||
}
|
||||
current_voice_id[0] = 0;
|
||||
|
||||
n_param_stack = 1;
|
||||
|
||||
+6
-2
@@ -646,11 +646,13 @@ ESPEAK_API int espeak_Initialize(espeak_AUDIO_OUTPUT output_type, int buf_length
|
||||
buf_length = 200;
|
||||
outbuf_size = (buf_length * samplerate)/500;
|
||||
outbuf = (unsigned char*)realloc(outbuf,outbuf_size);
|
||||
out_start = outbuf;
|
||||
if((out_start = outbuf) == NULL)
|
||||
return(EE_INTERNAL_ERROR);
|
||||
|
||||
// allocate space for event list. Allow 500 events per minute
|
||||
n_event_list = (buf_length*500)/1000;
|
||||
event_list = (espeak_EVENT *)realloc(event_list,sizeof(espeak_EVENT) * n_event_list);
|
||||
if((event_list = (espeak_EVENT *)realloc(event_list,sizeof(espeak_EVENT) * n_event_list)) == NULL)
|
||||
return(EE_INTERNAL_ERROR);
|
||||
|
||||
option_phonemes = 0;
|
||||
|
||||
@@ -1050,7 +1052,9 @@ ESPEAK_API espeak_ERROR espeak_Terminate(void)
|
||||
|
||||
#endif
|
||||
Free(event_list);
|
||||
event_list = NULL;
|
||||
Free(outbuf);
|
||||
outbuf = NULL;
|
||||
FreePhData();
|
||||
|
||||
return EE_OK;
|
||||
|
||||
+1
-1
@@ -145,7 +145,7 @@ int espeak_Initialize(espeak_AUDIO_OUTPUT output, int buflength, const char *pat
|
||||
|
||||
path: The directory which contains the espeak-data directory, or NULL for the default location.
|
||||
|
||||
Returns: sample rate in Hz
|
||||
Returns: sample rate in Hz, or -1 (EE_INTERNAL_ERROR).
|
||||
*/
|
||||
|
||||
typedef int (t_espeak_callback)(short*, int, espeak_EVENT*);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -35,7 +35,7 @@
|
||||
#include "translate.h"
|
||||
#include "wave.h"
|
||||
|
||||
const char *version_string = "1.24.03 06.May.07";
|
||||
const char *version_string = "1.24.04 08.May.07";
|
||||
const int version_phdata = 0x012201;
|
||||
|
||||
int option_device_number = -1;
|
||||
|
||||
@@ -224,13 +224,13 @@ Translator *SelectTranslator(const char *name)
|
||||
|
||||
case L('f','r'): // french
|
||||
{
|
||||
static int stress_lengths_fr[8] = {180, 180, 180, 180, 0, 0, 220, 220};
|
||||
static int stress_lengths_fr[8] = {180, 160, 180, 190, 0, 0, 220, 220};
|
||||
static int stress_amps_fr[8] = {16,14, 20,20, 20,24, 24,22 };
|
||||
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_fr,stress_amps_fr);
|
||||
tr->langopts.stress_rule = 3; // stress on final syllable
|
||||
tr->langopts.stress_flags = 0x20; // don't use secondary stress
|
||||
tr->langopts.stress_flags = 0x0024; // don't use secondary stress
|
||||
tr->langopts.param[LOPT_IT_LENGTHEN] = 1; // remove lengthen indicator from unstressed syllables
|
||||
|
||||
tr->langopts.numbers = 0x1509;
|
||||
|
||||
+1
-1
@@ -254,7 +254,7 @@ typedef struct {
|
||||
// bit6=light syllable followed by heavy, move secondary stress to the heavy syllable. LANG=Finnish
|
||||
// bit8=stress last syllable if it doesn't end in a vowel
|
||||
// bit9=stress last syllable if it doesn't end in vowel or "s" or "n" LANG=Spanish
|
||||
// bit12= In 2-syllable words, give the first syllable a secondary stress
|
||||
// bit12= If there is only one syllable before the primary stress, give it a secondary stress
|
||||
|
||||
int stress_flags;
|
||||
int unstressed_wd1; // stress for $u word of 1 syllable
|
||||
|
||||
+10
-6
@@ -47,6 +47,9 @@ MNEM_TAB genders [] = {
|
||||
{"female", 2},
|
||||
{NULL, 0 }};
|
||||
|
||||
//int tone_points[10] = {250,140, 1200,110, -1,0, -1,0, -1,0};
|
||||
int tone_points[10] = {600,180, 1200,140, 2000,110, 3000,110, -1,0};
|
||||
|
||||
// limit the rate of change for each formant number
|
||||
//static int formant_rate_22050[9] = {50, 104, 165, 230, 220, 220, 220, 220, 220}; // values for 22kHz sample rate
|
||||
static int formant_rate_22050[9] = {50, 100, 165, 200, 200, 200, 200, 200, 200}; // values for 22kHz sample rate
|
||||
@@ -155,7 +158,6 @@ const char variants_female[N_VOICE_VARIANTS] = {11,12,13,14,0};
|
||||
const char *variant_lists[3] = {variants_either, variants_male, variants_female};
|
||||
|
||||
|
||||
int tone_points[10] = {250,140, 1200,110, -1,0, -1,0, -1,0};
|
||||
|
||||
void SetToneAdjust(voice_t *voice, int *tone_pts)
|
||||
{//==============================================
|
||||
@@ -544,11 +546,6 @@ voice_t *LoadVoice(char *vname, int control)
|
||||
}
|
||||
|
||||
f_voice = fopen(buf,"r");
|
||||
if(first_voice == NULL)
|
||||
{
|
||||
first_voice = ReadVoiceFile(f_voice,buf+len_path_voices,voicename);
|
||||
rewind(f_voice);
|
||||
}
|
||||
|
||||
language_type = "en"; // default
|
||||
if(f_voice == NULL)
|
||||
@@ -560,6 +557,13 @@ voice_t *LoadVoice(char *vname, int control)
|
||||
language_type = voicename;
|
||||
}
|
||||
|
||||
if(first_voice == NULL)
|
||||
{
|
||||
first_voice = ReadVoiceFile(f_voice,buf+strlen(path_voices),voicename);
|
||||
rewind(f_voice);
|
||||
}
|
||||
|
||||
|
||||
if(!tone_only && (translator != NULL))
|
||||
{
|
||||
delete translator;
|
||||
|
||||
Reference in New Issue
Block a user