From 72db232ec3ee3743b842ace4e16ba6254c6a0c02 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Mon, 4 Jan 2016 19:45:23 +0000 Subject: [PATCH 1/4] Move include/espeak{-ng => }/speak_lib.h. --- Makefile.am | 16 ++++++++++------ src/espeak-ng.c | 4 ++-- src/include/espeak-ng/espeak_ng.h | 2 +- src/include/{espeak-ng => espeak}/speak_lib.h | 0 src/libespeak-ng/compiledata.c | 4 ++-- src/libespeak-ng/compiledict.c | 4 ++-- src/libespeak-ng/compilembrola.c | 4 ++-- src/libespeak-ng/dictionary.c | 4 ++-- src/libespeak-ng/error.c | 2 +- src/libespeak-ng/espeak_api.c | 4 ++-- src/libespeak-ng/espeak_command.c | 2 +- src/libespeak-ng/espeak_command.h | 1 - src/libespeak-ng/event.c | 5 +++-- src/libespeak-ng/event.h | 2 -- src/libespeak-ng/fifo.c | 2 +- src/libespeak-ng/fifo.h | 1 - src/libespeak-ng/intonation.c | 4 ++-- src/libespeak-ng/klatt.c | 4 ++-- src/libespeak-ng/numbers.c | 4 ++-- src/libespeak-ng/phonemelist.c | 4 ++-- src/libespeak-ng/readclause.c | 4 ++-- src/libespeak-ng/setlengths.c | 4 ++-- src/libespeak-ng/spect.c | 4 ++-- src/libespeak-ng/speech.c | 4 ++-- src/libespeak-ng/synth_mbrola.c | 4 ++-- src/libespeak-ng/synthdata.c | 4 ++-- src/libespeak-ng/synthesize.c | 4 ++-- src/libespeak-ng/tr_languages.c | 4 ++-- src/libespeak-ng/translate.c | 4 ++-- src/libespeak-ng/voices.c | 4 ++-- src/libespeak-ng/wavegen.c | 4 ++-- src/speak-ng.c | 4 ++-- 32 files changed, 61 insertions(+), 60 deletions(-) rename src/include/{espeak-ng => espeak}/speak_lib.h (100%) diff --git a/Makefile.am b/Makefile.am index 0bea26d1..ba0b7fba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -84,14 +84,18 @@ docs: docs/index.html \ ##### build targets: -libespeak_ng_includedir = $(includedir)/espeak-ng -libespeak_ng_include_HEADERS = \ - src/include/espeak-ng/speak_lib.h +espeak_includedir = $(includedir)/espeak +espeak_include_HEADERS = \ + src/include/espeak/speak_lib.h + +espeak_ng_includedir = $(includedir)/espeak-ng +espeak_ng_include_HEADERS = \ + src/include/espeak-ng/espeak_ng.h lib_LTLIBRARIES += src/libespeak-ng.la src_libespeak_ng_la_LDFLAGS = -version-info $(SHARED_VERSION) -lpthread -lm -src_libespeak_ng_la_CFLAGS = -Isrc/include/espeak-ng \ +src_libespeak_ng_la_CFLAGS = -Isrc/include \ -fPIC -fvisibility=hidden -D _BSD_SOURCE -D _POSIX_C_SOURCE=200112L \ -pedantic -fno-exceptions -D PATH_ESPEAK_DATA=\"$(DATADIR)\" src_libespeak_ng_la_SOURCES = \ @@ -170,7 +174,7 @@ endif src_speak_ng_LDADD = src/libespeak-ng.la src_speak_ng_LDFLAGS = -static -src_speak_ng_CFLAGS = -Isrc/libespeak-ng -Isrc/include/espeak-ng -D _POSIX_C_SOURCE=200112L +src_speak_ng_CFLAGS = -Isrc/libespeak-ng -Isrc/include -D _POSIX_C_SOURCE=200112L src_speak_ng_SOURCES = src/speak-ng.c bin_PROGRAMS += src/espeak-ng @@ -180,7 +184,7 @@ man1_MANS += src/espeak-ng.1 endif src_espeak_ng_LDADD = src/libespeak-ng.la -src_espeak_ng_CFLAGS = -Isrc/include/espeak-ng +src_espeak_ng_CFLAGS = -Isrc/include src_espeak_ng_SOURCES = src/espeak-ng.c ##### phoneme data: diff --git a/src/espeak-ng.c b/src/espeak-ng.c index ef27493a..f67356a4 100644 --- a/src/espeak-ng.c +++ b/src/espeak-ng.c @@ -28,8 +28,8 @@ #include #include -#include "speak_lib.h" -#include "espeak_ng.h" +#include +#include extern void strncpy0(char *to, const char *from, int size); extern int utf8_in(int *c, const char *buf); diff --git a/src/include/espeak-ng/espeak_ng.h b/src/include/espeak-ng/espeak_ng.h index e270fcb2..149001ac 100644 --- a/src/include/espeak-ng/espeak_ng.h +++ b/src/include/espeak-ng/espeak_ng.h @@ -19,7 +19,7 @@ #ifndef ESPEAK_NG_H #define ESPEAK_NG_H -#include "speak_lib.h" +#include #ifdef __cplusplus extern "C" diff --git a/src/include/espeak-ng/speak_lib.h b/src/include/espeak/speak_lib.h similarity index 100% rename from src/include/espeak-ng/speak_lib.h rename to src/include/espeak/speak_lib.h diff --git a/src/libespeak-ng/compiledata.c b/src/libespeak-ng/compiledata.c index dac100d6..7fe31089 100644 --- a/src/libespeak-ng/compiledata.c +++ b/src/libespeak-ng/compiledata.c @@ -30,8 +30,8 @@ #include #endif -#include "speak_lib.h" -#include "espeak_ng.h" +#include +#include #include "error.h" #include "speech.h" diff --git a/src/libespeak-ng/compiledict.c b/src/libespeak-ng/compiledict.c index 237af92d..3de555d2 100644 --- a/src/libespeak-ng/compiledict.c +++ b/src/libespeak-ng/compiledict.c @@ -30,8 +30,8 @@ #include #endif -#include "espeak_ng.h" -#include "speak_lib.h" +#include +#include #include "error.h" #include "speech.h" diff --git a/src/libespeak-ng/compilembrola.c b/src/libespeak-ng/compilembrola.c index 24a93643..bac34120 100644 --- a/src/libespeak-ng/compilembrola.c +++ b/src/libespeak-ng/compilembrola.c @@ -27,8 +27,8 @@ #include #endif -#include "speak_lib.h" -#include "espeak_ng.h" +#include +#include #include "error.h" #include "phoneme.h" diff --git a/src/libespeak-ng/dictionary.c b/src/libespeak-ng/dictionary.c index 1a03c17e..1784eb7e 100644 --- a/src/libespeak-ng/dictionary.c +++ b/src/libespeak-ng/dictionary.c @@ -30,8 +30,8 @@ #include #include -#include "espeak_ng.h" -#include "speak_lib.h" +#include +#include #include "speech.h" #include "phoneme.h" diff --git a/src/libespeak-ng/error.c b/src/libespeak-ng/error.c index 662c85e7..467cbac0 100644 --- a/src/libespeak-ng/error.c +++ b/src/libespeak-ng/error.c @@ -26,7 +26,7 @@ #include #include -#include "espeak_ng.h" +#include #include "error.h" #include "speech.h" diff --git a/src/libespeak-ng/espeak_api.c b/src/libespeak-ng/espeak_api.c index c6ce7b39..50b3704b 100644 --- a/src/libespeak-ng/espeak_api.c +++ b/src/libespeak-ng/espeak_api.c @@ -20,8 +20,8 @@ #include "config.h" -#include "speak_lib.h" -#include "espeak_ng.h" +#include +#include #include #if HAVE_STDINT_H diff --git a/src/libespeak-ng/espeak_command.c b/src/libespeak-ng/espeak_command.c index 90d7b965..67355a95 100644 --- a/src/libespeak-ng/espeak_command.c +++ b/src/libespeak-ng/espeak_command.c @@ -18,7 +18,7 @@ #include "config.h" -#include "espeak_ng.h" +#include #include "speech.h" #include "espeak_command.h" diff --git a/src/libespeak-ng/espeak_command.h b/src/libespeak-ng/espeak_command.h index f8cd94ca..aa710672 100644 --- a/src/libespeak-ng/espeak_command.h +++ b/src/libespeak-ng/espeak_command.h @@ -22,7 +22,6 @@ #ifndef PLATFORM_WINDOWS #include #endif -#include "speak_lib.h" #ifdef __cplusplus extern "C" diff --git a/src/libespeak-ng/event.c b/src/libespeak-ng/event.c index 15a960a4..18d30dd8 100644 --- a/src/libespeak-ng/event.c +++ b/src/libespeak-ng/event.c @@ -32,9 +32,10 @@ #include #include +#include +#include + #include "speech.h" -#include "espeak_ng.h" -#include "speak_lib.h" #include "event.h" #include "wave.h" diff --git a/src/libespeak-ng/event.h b/src/libespeak-ng/event.h index c80ecf5c..0cf43a67 100644 --- a/src/libespeak-ng/event.h +++ b/src/libespeak-ng/event.h @@ -39,8 +39,6 @@ */ -#include "speak_lib.h" - #ifdef __cplusplus extern "C" { diff --git a/src/libespeak-ng/fifo.c b/src/libespeak-ng/fifo.c index a01104c6..4f48c37d 100644 --- a/src/libespeak-ng/fifo.c +++ b/src/libespeak-ng/fifo.c @@ -33,7 +33,7 @@ #include #include -#include "espeak_ng.h" +#include #include "speech.h" #include "fifo.h" diff --git a/src/libespeak-ng/fifo.h b/src/libespeak-ng/fifo.h index 7fcab180..a1e5937c 100644 --- a/src/libespeak-ng/fifo.h +++ b/src/libespeak-ng/fifo.h @@ -23,7 +23,6 @@ // and run them asynchronously. #include "espeak_command.h" -#include "speak_lib.h" #ifdef __cplusplus extern "C" diff --git a/src/libespeak-ng/intonation.c b/src/libespeak-ng/intonation.c index 8b4d99ec..1fcc9b47 100644 --- a/src/libespeak-ng/intonation.c +++ b/src/libespeak-ng/intonation.c @@ -27,8 +27,8 @@ #include #endif -#include "espeak_ng.h" -#include "speak_lib.h" +#include +#include #include "speech.h" #include "phoneme.h" diff --git a/src/libespeak-ng/klatt.c b/src/libespeak-ng/klatt.c index 87656923..0799f7da 100644 --- a/src/libespeak-ng/klatt.c +++ b/src/libespeak-ng/klatt.c @@ -33,8 +33,8 @@ #include #endif -#include "espeak_ng.h" -#include "speak_lib.h" +#include +#include #include "speech.h" #include "klatt.h" diff --git a/src/libespeak-ng/numbers.c b/src/libespeak-ng/numbers.c index dfa0447a..2a3029cd 100644 --- a/src/libespeak-ng/numbers.c +++ b/src/libespeak-ng/numbers.c @@ -31,8 +31,8 @@ #include #include -#include "espeak_ng.h" -#include "speak_lib.h" +#include +#include #include "speech.h" #include "phoneme.h" diff --git a/src/libespeak-ng/phonemelist.c b/src/libespeak-ng/phonemelist.c index f163fd91..97d107b5 100644 --- a/src/libespeak-ng/phonemelist.c +++ b/src/libespeak-ng/phonemelist.c @@ -26,8 +26,8 @@ #include #endif -#include "espeak_ng.h" -#include "speak_lib.h" +#include +#include #include "speech.h" #include "phoneme.h" diff --git a/src/libespeak-ng/readclause.c b/src/libespeak-ng/readclause.c index 8e3288a3..0aab3188 100644 --- a/src/libespeak-ng/readclause.c +++ b/src/libespeak-ng/readclause.c @@ -30,8 +30,8 @@ #include #endif -#include "espeak_ng.h" -#include "speak_lib.h" +#include +#include #include "speech.h" #include "phoneme.h" diff --git a/src/libespeak-ng/setlengths.c b/src/libespeak-ng/setlengths.c index 1f8b802e..7ba51e3b 100644 --- a/src/libespeak-ng/setlengths.c +++ b/src/libespeak-ng/setlengths.c @@ -27,8 +27,8 @@ #include #endif -#include "espeak_ng.h" -#include "speak_lib.h" +#include +#include #include "speech.h" #include "phoneme.h" diff --git a/src/libespeak-ng/spect.c b/src/libespeak-ng/spect.c index 18172c70..183e668c 100644 --- a/src/libespeak-ng/spect.c +++ b/src/libespeak-ng/spect.c @@ -25,8 +25,8 @@ #include #endif -#include "espeak_ng.h" -#include "speak_lib.h" +#include +#include #include "speech.h" #include "phoneme.h" diff --git a/src/libespeak-ng/speech.c b/src/libespeak-ng/speech.c index e23544c0..a130d9a2 100644 --- a/src/libespeak-ng/speech.c +++ b/src/libespeak-ng/speech.c @@ -41,8 +41,8 @@ #include #endif -#include "espeak_ng.h" -#include "speak_lib.h" +#include +#include #include "phoneme.h" #include "synthesize.h" diff --git a/src/libespeak-ng/synth_mbrola.c b/src/libespeak-ng/synth_mbrola.c index 6716757d..d6a39f83 100644 --- a/src/libespeak-ng/synth_mbrola.c +++ b/src/libespeak-ng/synth_mbrola.c @@ -30,8 +30,8 @@ #include #endif -#include "espeak_ng.h" -#include "speak_lib.h" +#include +#include #include "speech.h" #include "phoneme.h" diff --git a/src/libespeak-ng/synthdata.c b/src/libespeak-ng/synthdata.c index 1ab8943f..e916fd20 100644 --- a/src/libespeak-ng/synthdata.c +++ b/src/libespeak-ng/synthdata.c @@ -30,8 +30,8 @@ #include #endif -#include "espeak_ng.h" -#include "speak_lib.h" +#include +#include #include "error.h" #include "speech.h" diff --git a/src/libespeak-ng/synthesize.c b/src/libespeak-ng/synthesize.c index 0692cca3..71418384 100644 --- a/src/libespeak-ng/synthesize.c +++ b/src/libespeak-ng/synthesize.c @@ -29,8 +29,8 @@ #include #endif -#include "espeak_ng.h" -#include "speak_lib.h" +#include +#include #include "speech.h" #include "phoneme.h" diff --git a/src/libespeak-ng/tr_languages.c b/src/libespeak-ng/tr_languages.c index 59169c4c..adad2942 100644 --- a/src/libespeak-ng/tr_languages.c +++ b/src/libespeak-ng/tr_languages.c @@ -31,8 +31,8 @@ #include -#include "espeak_ng.h" -#include "speak_lib.h" +#include +#include #include "speech.h" #include "phoneme.h" diff --git a/src/libespeak-ng/translate.c b/src/libespeak-ng/translate.c index 74a98c8c..7cf1b72f 100644 --- a/src/libespeak-ng/translate.c +++ b/src/libespeak-ng/translate.c @@ -30,8 +30,8 @@ #include #include -#include "espeak_ng.h" -#include "speak_lib.h" +#include +#include #include "speech.h" #include "phoneme.h" diff --git a/src/libespeak-ng/voices.c b/src/libespeak-ng/voices.c index 6cbd26ba..9340505b 100644 --- a/src/libespeak-ng/voices.c +++ b/src/libespeak-ng/voices.c @@ -36,8 +36,8 @@ #include "dirent.h" #endif -#include "espeak_ng.h" -#include "speak_lib.h" +#include +#include #include "phoneme.h" #include "synthesize.h" diff --git a/src/libespeak-ng/wavegen.c b/src/libespeak-ng/wavegen.c index 6809f28e..73412748 100644 --- a/src/libespeak-ng/wavegen.c +++ b/src/libespeak-ng/wavegen.c @@ -30,8 +30,8 @@ #include #endif -#include "espeak_ng.h" -#include "speak_lib.h" +#include +#include #include "speech.h" #include "phoneme.h" diff --git a/src/speak-ng.c b/src/speak-ng.c index c717f562..60f89de6 100644 --- a/src/speak-ng.c +++ b/src/speak-ng.c @@ -46,8 +46,8 @@ #include #include -#include "espeak_ng.h" -#include "speak_lib.h" +#include +#include #include "phoneme.h" #include "synthesize.h" From cd64bfeb53884d44eee497fa38759c40487ac8d6 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Mon, 4 Jan 2016 20:13:48 +0000 Subject: [PATCH 2/4] Install the espeak compatibility symlinks. --- Makefile.am | 5 +++++ configure.ac | 1 + 2 files changed, 6 insertions(+) diff --git a/Makefile.am b/Makefile.am index ba0b7fba..24611c9e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -44,6 +44,11 @@ install-data-hook: uninstall-hook $(MKDIR) $(DESTDIR)$(DATADIR) cp -prf espeak-data/* $(DESTDIR)$(DATADIR) +install-exec-hook: + cd $(DESTDIR)$(BINDIR) && rm -f espeak && $(LN_S) espeak-ng espeak + cd $(DESTDIR)$(BINDIR) && rm -f speak && $(LN_S) speak-ng speak + cd $(DESTDIR)$(LIBDIR) && rm -f libespeak.la && $(LN_S) libespeak-ng.la libespeak.la + clean-local: cd src && rm -f *.o *~ && cd .. diff --git a/configure.ac b/configure.ac index 8df45b73..08ecfa15 100644 --- a/configure.ac +++ b/configure.ac @@ -17,6 +17,7 @@ dnl ================================================================ AC_PROG_CC AC_PROG_MAKE_SET AC_PROG_LIBTOOL +AC_PROG_LN_S dnl ================================================================ dnl C99 compiler checks. From ee6f93668eccb069c52408f0711c7183646fd479 Mon Sep 17 00:00:00 2001 From: Valdis Vitolins Date: Mon, 4 Jan 2016 21:55:44 +0200 Subject: [PATCH 3/4] Documentation: Fixes for intonation.md file --- docs/add_language.md | 34 ++++++++++++++++++++++++++++++++++ docs/intonation.md | 4 ++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/docs/add_language.md b/docs/add_language.md index 880c386f..28cc504b 100644 --- a/docs/add_language.md +++ b/docs/add_language.md @@ -1,11 +1,14 @@ # Adding or Improving a Language +# Table of contents + - [Language Code](#language-code) - [Language Files](#language-files) - [Voice File](#voice-file) - [Phoneme Definition File](#phoneme-definition-file) - [Dictionary Files](#dictionary-files) - [Program Code](#program-code) +- [Compiling rules file for debugging](#compiling-rules-file-for-debugging) - [Improving a Language](#improving-a-language) ---------- @@ -163,6 +166,37 @@ required options in `SetTranslator()`. However, this may not be necessary during testing because most of the options can also be set in the voice file in espeak-data/voices (see [Voice Files](voices.md)). +## Compiling rules file for debugging + +When `espeak-ng` is invoked with `-X` parameter, it shows more detailed trace of +chosen language rules for pronunciation. This trace can show line numbers also, +if language is compiled with `--compile-debug` option. + +To do this, go to `espeak-ng` project root folder, then: + + cd dictsource/ + ../src/espeak-ng --compile-debug=en + +When invoked in following way: + + es -ven -X "Test." + +It will show: + +``` +-------------- +Translate 'test' + 1 5965: t [t] + + 1 2104: e [E] + + 1 5725: s [s] + + 1 5965: t [t] + + t'Est +``` + ## Improving a Language Listen carefully to the eSpeak voice. Try to identify what sounds wrong diff --git a/docs/intonation.md b/docs/intonation.md index 2df3b0b2..ae329f14 100644 --- a/docs/intonation.md +++ b/docs/intonation.md @@ -108,7 +108,7 @@ are specified. `start pitch` give a pitch path for the stressed syllables of the head. -steps` is the maximum number of stressed syllables for which this applies. If +`steps` is the maximum number of stressed syllables for which this applies. If there are additional stressed syllables, then the `headextend` statement is used for them. @@ -122,7 +122,7 @@ than the previous stressed syllable. headextend If the head contains more stressed syllables than is specified by `steps` is used. -Itmcontains up to 8 numbers which are used repeatedly for the additional stressed +It contains up to 8 numbers which are used repeatedly for the additional stressed syllables. A value of 0 corresponds to the lower the `start pitch` values of the `head` statement. 100 corresponds to the higher value. From adfb05964a1f37d505ef69fecfb6ae737866df42 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Mon, 4 Jan 2016 20:23:23 +0000 Subject: [PATCH 4/4] docs/add_language.md style and other fixes --- docs/add_language.md | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/docs/add_language.md b/docs/add_language.md index 28cc504b..aa16bd52 100644 --- a/docs/add_language.md +++ b/docs/add_language.md @@ -1,14 +1,12 @@ # Adding or Improving a Language -# Table of contents - - [Language Code](#language-code) - [Language Files](#language-files) - [Voice File](#voice-file) - [Phoneme Definition File](#phoneme-definition-file) - [Dictionary Files](#dictionary-files) - [Program Code](#program-code) -- [Compiling rules file for debugging](#compiling-rules-file-for-debugging) +- [Compiling Rules File for Debugging](#compiling-rules-file-for-debugging) - [Improving a Language](#improving-a-language) ---------- @@ -166,7 +164,7 @@ required options in `SetTranslator()`. However, this may not be necessary during testing because most of the options can also be set in the voice file in espeak-data/voices (see [Voice Files](voices.md)). -## Compiling rules file for debugging +## Compiling Rules File for Debugging When `espeak-ng` is invoked with `-X` parameter, it shows more detailed trace of chosen language rules for pronunciation. This trace can show line numbers also, @@ -174,28 +172,25 @@ if language is compiled with `--compile-debug` option. To do this, go to `espeak-ng` project root folder, then: - cd dictsource/ - ../src/espeak-ng --compile-debug=en + cd dictsource + ../src/espeak-ng --compile-debug=en When invoked in following way: - es -ven -X "Test." + espeak-ng -ven -X "Test." It will show: -``` --------------- -Translate 'test' - 1 5965: t [t] - - 1 2104: e [E] - - 1 5725: s [s] - - 1 5965: t [t] - - t'Est -``` + Translate 'test' + 1 5965: t [t] + + 1 2104: e [E] + + 1 5725: s [s] + + 1 5965: t [t] + + t'Est ## Improving a Language