From 304d265f462fa4854c7d1f953131c69937a2fe74 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Fri, 23 Aug 2013 13:30:45 +0100 Subject: [PATCH 1/4] Fix a SEGFAULT in GetTranslatedPhonemeString. When running any of the following: espeak -x "[[]]" espeak --ipa "[[]]" eSpeak would SEGFAULT. This is because phon_out_buf is NULL as no phonemes have been written and as this is the first call to GetTranslatedPhonemeString, the phoneme buffer has not been allocated yet. However, GetTranslatedPhonemeString attempts to add a NULL character to the end of the phoneme buffer, and thus crashes. --- src/dictionary.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/dictionary.cpp b/src/dictionary.cpp index 87ef77b0..45f9da2f 100644 --- a/src/dictionary.cpp +++ b/src/dictionary.cpp @@ -1,6 +1,7 @@ /*************************************************************************** * Copyright (C) 2005 to 2013 by Jonathan Duddington * * email: jonsd@users.sourceforge.net * + * Copyright (C) 2013 Reece H. Dunn * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -769,6 +770,10 @@ const char *GetTranslatedPhonemeString(int phoneme_mode) strcpy(&phon_out_buf[phon_out_ix], phon_buf); phon_out_ix += len; } + + if (!phon_out_buf) + return(""); + phon_out_buf[phon_out_ix] = 0; return(phon_out_buf); From c098e8b8910c1bffdd878198095fee803d8bd73a Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sat, 24 Aug 2013 16:42:56 +0100 Subject: [PATCH 2/4] ph_english: use /i/ as the IPA transcription of i MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The i phoneme is used for the reduced i sound in e.g. happy (/h'api/). Thus, the following words contrast: word eSpeak IPA happy /h'api/ /hˈapi/ been /b'i:n/ /bˈiːn/ bin /b'In/ /bˈɪn/ Before this change, /h'api/ would be transcribed in IPA as /hˈapɪ/ which is wrong. After this change, it is transcribed correctly. --- phsource/ph_english | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phsource/ph_english b/phsource/ph_english index 427e5da3..46b1996e 100644 --- a/phsource/ph_english +++ b/phsource/ph_english @@ -250,7 +250,7 @@ endphoneme phoneme i // optional variant of [I] for end of words vowel starttype #i endtype #i - ipa ɪ + ipa i length 140 IfNextVowelAppend(;) FMT(vowel/ii_7) From 2c8198febb6cb822d63685df787c62462ee1aa57 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Wed, 28 Aug 2013 12:17:14 +0100 Subject: [PATCH 3/4] README.md: Improve the build instructions and add a section on building/adding voices. --- README.md | 51 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0034bc79..71182377 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,8 @@ The espeak and espeakedit programs, along with the espeak voices, can be built via the standard autotools commands: $ ./autogen.sh - $ ./configure + $ ./configure --prefix=/usr $ make - $ sudo make install __NOTE:__ The configure command detects various platform differences that the espeak makefiles don't cater for (e.g. different wxWidgets version) @@ -31,12 +30,58 @@ and detect the available audio setup to use automatically. Before installing, you can test the built espeak using the following command: - $ ESPEAK_DATA_PATH=`pwd` src/espeak hello + $ ESPEAK_DATA_PATH=`pwd` LD_LIBRARY_PATH=src:${LD_LIBRARY_PATH} src/espeak ... The `ESPEAK_DATA_PATH` variable needs to be set to use the espeak data from the source tree. Otherwise, espeak will look in `$(HOME)` or `/usr/share/espeak-data`. +The `LD_LIBRARY_PATH` is set as `espeak` uses the `libespeak.so` shared +library. This ensures that `espeak` uses the built shared library in the +`src` directory and not the one on the system (which could be an older +version). + +## Installing + +You can install eSpeak by running the following command: + + $ sudo make LIBDIR=/usr/lib/x86_64-linux-gnu install + +The `LIBDIR` path may be different to the one on your system (the above +is for 64-bit Debian/Ubuntu releases that use the multi-arch package +structure -- that is, Debian Wheezy or later). + +You can find out where espeak is installed to on your system if you +already have an espeak install by running: + + $ find /usr/lib | grep libespeak + +## Voices + +If you are modifying a language's phoneme, voice or dictionary files, you +can just build that voice by running: + + $ make + +For example, if you add entries in the `dictsource/en_extra` file, you can +run: + + $ make en + +to build an English voice file with those changes in without rebuilding +all the voices. This will make it easier to spot errors. + +### Adding New Voices + +Once you have added the necessary files to eSpeak to support the new voice, +you can then run: + + $ ./mkdictlist Makefile.am + +This will update the build system so that `make` will build the new voice +in addition to building everything else, and add a `` target +for building just that voice. + ## Historical Releases 1.24.02 is the first version of eSpeak to appear in the subversion From 5f8762ae91444b7ad46dad851ee88e40e8ec88ea Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sat, 31 Aug 2013 10:06:38 +0100 Subject: [PATCH 4/4] src/wave.cpp: fix building when portaudio.h is missing --- src/wave.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wave.cpp b/src/wave.cpp index b3e6593a..487df13b 100644 --- a/src/wave.cpp +++ b/src/wave.cpp @@ -31,7 +31,6 @@ #include #include -#include "portaudio.h" #ifndef PLATFORM_WINDOWS #include #endif @@ -43,6 +42,7 @@ enum {ONE_BILLION=1000000000}; #ifdef USE_PORTAUDIO +#include "portaudio.h" #undef USE_PORTAUDIO // determine portaudio version by looking for a #define which is not in V18