mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-27 13:23:49 +00:00
[1.36]
espeak_Key(key_name) If key_name is a single character, it speaks the character name. Otherwise it speaks key_name as a text string. This is the same behaviour as <say-as interpret-as="tts:key"> Fix: SAPI5 was restricted to 360 wmp. Now the top speed (390 wpm) is allowed. Fix error in phoneme translation data for mbrola "cr1" Croation voice. *_list files: Allow word groups which have no phoneme translation, so that just attributes can be set. The words are considered as a single hyphenated word. Fix: $textmode in *_list files, allow replacement by a word which is also translated in the *_list file. lang=pl: many additions to pl_rules, pl_list git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@165 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+12
-10
@@ -6,7 +6,7 @@ INCDIR=$(PREFIX)/usr/include/espeak
|
||||
LIBDIR=$(PREFIX)/usr/lib
|
||||
DATADIR=$(PREFIX)/usr/share/espeak-data
|
||||
|
||||
RELEASE = 1.35
|
||||
RELEASE = 1.36
|
||||
BIN_NAME = speak
|
||||
BIN2_NAME = espeak
|
||||
LIB_NAME = libespeak.so
|
||||
@@ -30,12 +30,14 @@ AUDIO = portaudio
|
||||
|
||||
ifeq ($(AUDIO),pulseaudio)
|
||||
WAVE=wave_pulse.cpp
|
||||
LIB_AUDIO=pulse
|
||||
USE_AUDIO=USE_PULSEAUDIO
|
||||
LIB_AUDIO=-lpulse
|
||||
USE_AUDIO=-DUSE_PULSEAUDIO
|
||||
else ifeq ($(AUDIO),portaudio)
|
||||
WAVE=wave.cpp
|
||||
LIB_AUDIO=-lportaudio
|
||||
USE_AUDIO=-DUSE_PORTAUDIO
|
||||
else
|
||||
WAVE=wave.cpp
|
||||
LIB_AUDIO=portaudio
|
||||
USE_AUDIO=USE_PORTAUDIO
|
||||
endif
|
||||
|
||||
speak_SOURCES = speak.cpp compiledict.cpp dictionary.cpp intonation.cpp \
|
||||
@@ -51,24 +53,24 @@ libespeak_SOURCES = speak_lib.cpp compiledict.cpp dictionary.cpp intonation.cpp
|
||||
|
||||
SRCS1=$(speak_SOURCES)
|
||||
OBJS1=$(patsubst %.cpp,%.o,$(SRCS1))
|
||||
LIBS1=-lstdc++ -l$(LIB_AUDIO) -lpthread $(EXTRA_LIBS)
|
||||
LIBS1=-lstdc++ $(LIB_AUDIO) -lpthread $(EXTRA_LIBS)
|
||||
|
||||
SRCS2=$(libespeak_SOURCES)
|
||||
OBJS2=$(patsubst %.cpp,x_%.o,$(SRCS2))
|
||||
LIBS2=-lstdc++ -l$(LIB_AUDIO) -lpthread
|
||||
LIBS2=-lstdc++ $(LIB_AUDIO) -lpthread
|
||||
|
||||
SRCS3 = espeak.cpp
|
||||
OBJS3=$(patsubst %.cpp,%.o,$(SRCS3))
|
||||
LIBS3=-lstdc++ -L . -lespeak
|
||||
|
||||
CXXFLAGS=-O2 -D$(USE_AUDIO)
|
||||
CXXFLAGS=-O2
|
||||
|
||||
|
||||
all: $(BIN_NAME) $(LIB_NAME) $(STATIC_LIB_NAME) $(BIN2_NAME)
|
||||
mv $(LIB_NAME) $(LIB_NAME).$(LIBTAG)
|
||||
|
||||
.cpp.o:
|
||||
$(CXX) $(CXXFLAGS) -D PATH_ESPEAK_DATA=\"$(DATADIR)\" -Wall -pedantic -I. -c -fno-exceptions $<
|
||||
$(CXX) $(CXXFLAGS) $(USE_AUDIO) -D PATH_ESPEAK_DATA=\"$(DATADIR)\" -Wall -pedantic -I. -c -fno-exceptions $<
|
||||
|
||||
$(BIN_NAME): $(OBJS1)
|
||||
$(CXX) -o $@ $(OBJS1) $(LIBS1)
|
||||
@@ -79,7 +81,7 @@ $(BIN2_NAME): $(OBJS3) $(LIB_NAME)
|
||||
|
||||
|
||||
x_%.o: %.cpp
|
||||
$(CXX) $(CXXFLAGS) -Wall -fpic -pedantic \
|
||||
$(CXX) $(CXXFLAGS) $(USE_AUDIO) -Wall -fpic -pedantic \
|
||||
-I. -D LIBRARY -c -fno-exceptions $< -o x_$*.o
|
||||
|
||||
$(LIB_NAME): $(OBJS2)
|
||||
|
||||
+1
-1
@@ -721,7 +721,7 @@ void Translator::SetSpellingStress(char *phonemes, int control, int n_chars)
|
||||
|
||||
if(control == 4)
|
||||
c = phonPAUSE; // pause after each character
|
||||
if(((count % 3) == 0) || (control == 4))
|
||||
if(((count % 3) == 0) || (control > 2))
|
||||
c = phonPAUSE_SHORT; // pause following a primary stress
|
||||
else
|
||||
continue; // remove marker
|
||||
|
||||
+1
-1
@@ -1979,7 +1979,7 @@ f_input = f_in; // for GetC etc
|
||||
c2 = ' ';
|
||||
}
|
||||
|
||||
if((sayas_mode == 0x14) && (c1 <= 0x20))
|
||||
if((c1 <= 0x20) && ((sayas_mode == SAYAS_SINGLE_CHARS) || (sayas_mode == SAYAS_KEY)))
|
||||
{
|
||||
c1 += 0xe000; // move into unicode private usage area
|
||||
}
|
||||
|
||||
+12
-1
@@ -612,9 +612,20 @@ espeak_ERROR sync_espeak_Synth_Mark(unsigned int unique_identifier, const void *
|
||||
void sync_espeak_Key(const char *key)
|
||||
{//==================================
|
||||
// symbolic name, symbolicname_character - is there a system resource of symbolic names per language?
|
||||
int letter;
|
||||
int ix;
|
||||
|
||||
ix = utf8_in(&letter,key,0);
|
||||
if(key[ix] == 0)
|
||||
{
|
||||
// a single character
|
||||
sync_espeak_Char(letter);
|
||||
return;
|
||||
}
|
||||
|
||||
my_unique_identifier = 0;
|
||||
my_user_data = NULL;
|
||||
Synthesize(0, key,0); // for now, just say the key name as passed
|
||||
Synthesize(0, key,0); // speak key as a text string
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-1
@@ -318,7 +318,8 @@ extern "C"
|
||||
#endif
|
||||
espeak_ERROR espeak_Key(const char *key_name);
|
||||
/* Speak the name of a keyboard key.
|
||||
Currently this just speaks the "key_name" as given
|
||||
If key_name is a single character, it speaks the name of the character.
|
||||
Otherwise, it speaks key_name as a text string.
|
||||
|
||||
Return: EE_OK: operation achieved
|
||||
EE_BUFFER_FULL: the command can not be buffered;
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
#include "translate.h"
|
||||
#include "wave.h"
|
||||
|
||||
const char *version_string = "1.35 07.Mar.08";
|
||||
const char *version_string = "1.36 09.Mar.08";
|
||||
const int version_phdata = 0x013400;
|
||||
|
||||
int option_device_number = -1;
|
||||
|
||||
@@ -534,7 +534,7 @@ SetLengthMods(tr,3); // all equal
|
||||
tr->langopts.max_initial_consonants = 7; // for example: wchrzczony :)
|
||||
tr->langopts.numbers=0x1009 + 0x4000;
|
||||
tr->langopts.numbers2=0x40;
|
||||
tr->langopts.param[LOPT_COMBINE_WORDS] = 2 + 0x100; // combine 'nie' (marked with $alt2) with some 1-syllable words (marked with $alt)
|
||||
tr->langopts.param[LOPT_COMBINE_WORDS] = 4 + 0x100; // combine 'nie' (marked with $alt2) with some 1-syllable (and 2-syllable) words (marked with $alt)
|
||||
SetLetterVowel(tr,'y');
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -637,6 +637,7 @@ int Translator::TranslateWord(char *word1, int next_pause, WORD_TAB *wtab)
|
||||
int prefix_flags = 0;
|
||||
int confirm_prefix;
|
||||
int spell_word;
|
||||
int stress_bits;
|
||||
int emphasize_allcaps = 0;
|
||||
int wflags = wtab->flags;
|
||||
int wmark = wtab->wmark;
|
||||
@@ -684,6 +685,37 @@ int Translator::TranslateWord(char *word1, int next_pause, WORD_TAB *wtab)
|
||||
else
|
||||
{
|
||||
found = LookupDictList(&word1, phonemes, dictionary_flags, FLAG_ALLOW_TEXTMODE, wtab); // the original word
|
||||
if(dictionary_flags[0] & FLAG_TEXTMODE)
|
||||
{
|
||||
stress_bits = dictionary_flags[0] & 0x7f;
|
||||
found = LookupDictList(&word1, phonemes, dictionary_flags2, 0, wtab); // the text replacement
|
||||
if(dictionary_flags2[0]!=0)
|
||||
{
|
||||
dictionary_flags[0] = dictionary_flags2[0];
|
||||
dictionary_flags[1] = dictionary_flags2[1];
|
||||
if(stress_bits != 0)
|
||||
{
|
||||
// keep any stress information from the original word
|
||||
dictionary_flags[0] = (dictionary_flags[0] & ~0x7f) | stress_bits;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if((found==0) && (dictionary_flags[0] & FLAG_SKIPWORDS))
|
||||
{
|
||||
// grouped words, but no translation. Join the words with hyphens.
|
||||
wordx = word1;
|
||||
ix = 0;
|
||||
while(ix < dictionary_skipwords)
|
||||
{
|
||||
if(*wordx == ' ')
|
||||
{
|
||||
*wordx = '-';
|
||||
ix++;
|
||||
}
|
||||
wordx++;
|
||||
}
|
||||
}
|
||||
|
||||
// if textmode, LookupDictList() replaces word1 by the new text and returns found=0
|
||||
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@
|
||||
|
||||
|
||||
/* dictionary flags, word 1 */
|
||||
// bits 0-3 stressed syllable, 7=unstressed
|
||||
// bits 0-3 stressed syllable, bit 6=unstressed
|
||||
#define FLAG_SKIPWORDS 0x80
|
||||
#define FLAG_PREPAUSE 0x100
|
||||
|
||||
|
||||
+1
-1
@@ -145,7 +145,7 @@ int wcmdq_tail=0;
|
||||
|
||||
// pitch,speed,
|
||||
int embedded_default[N_EMBEDDED_VALUES] = {0,50,170,100,50, 0,0, 0,170,0,0,0,0,0};
|
||||
static int embedded_max[N_EMBEDDED_VALUES] = {0,0x7fff,360,300,99,99,99, 0,360,0,0,0,0,4};
|
||||
static int embedded_max[N_EMBEDDED_VALUES] = {0,0x7fff,400,300,99,99,99, 0,360,0,0,0,0,4};
|
||||
|
||||
#define N_CALLBACK_IX N_WAV_BUF-2 // adjust this delay to match display with the currently spoken word
|
||||
int current_source_index=0;
|
||||
|
||||
Reference in New Issue
Block a user