|
|
ce24cc |
From 6df30ecf05440a1a0f197817d3e39c15d04f15c0 Mon Sep 17 00:00:00 2001
|
|
|
ce24cc |
From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com>
|
|
|
ce24cc |
Date: Wed, 28 Feb 2018 22:49:07 +0100
|
|
|
ce24cc |
Subject: [PATCH] Add support for eSpeak-NG
|
|
|
ce24cc |
|
|
|
ce24cc |
It is mostly a copy of the eSpeak driver.
|
|
|
ce24cc |
|
|
|
ce24cc |
Squashed with Dave Mielke's commit:
|
|
|
ce24cc |
Some modifications to the introduction of the eSpeak-NG speech driver: (dm)
|
|
|
ce24cc |
|
|
|
ce24cc |
Fix the order of lists that are alphabetically sorted by driver code.
|
|
|
ce24cc |
Undo the changes to the derived Portuguese documents.
|
|
|
ce24cc |
---
|
|
|
ce24cc |
Documents/CONTRIBUTORS | 1 +
|
|
|
ce24cc |
Documents/Manual-BRLTTY/English/driver-codes.sgml | 1 +
|
|
|
ce24cc |
.../Manual-BRLTTY/English/speech-drivers.sgml | 2 +
|
|
|
ce24cc |
Documents/Manual-BRLTTY/French/driver-codes.sgml | 1 +
|
|
|
ce24cc |
Documents/Manual-BRLTTY/French/speech-drivers.sgml | 2 +
|
|
|
ce24cc |
Documents/README.DOS | 5 +-
|
|
|
ce24cc |
Documents/brltty.1.in | 3 +
|
|
|
ce24cc |
Documents/brltty.conf.in | 7 +
|
|
|
ce24cc |
Documents/speech-driver.csv | 1 +
|
|
|
ce24cc |
Drivers/Speech/eSpeak-NG/Makefile.in | 29 ++++
|
|
|
ce24cc |
Drivers/Speech/eSpeak-NG/README | 34 ++++
|
|
|
ce24cc |
Drivers/Speech/eSpeak-NG/speech.c | 174 +++++++++++++++++++++
|
|
|
ce24cc |
README | 1 +
|
|
|
ce24cc |
brltty.spec.in | 25 +++
|
|
|
ce24cc |
cfg-android | 1 +
|
|
|
ce24cc |
cfg-darwin | 1 +
|
|
|
ce24cc |
cfg-dos | 1 +
|
|
|
ce24cc |
config.mk.in | 1 +
|
|
|
ce24cc |
configure.ac | 4 +
|
|
|
ce24cc |
19 files changed, 292 insertions(+), 2 deletions(-)
|
|
|
ce24cc |
create mode 100644 Drivers/Speech/eSpeak-NG/Makefile.in
|
|
|
ce24cc |
create mode 100644 Drivers/Speech/eSpeak-NG/README
|
|
|
ce24cc |
create mode 100644 Drivers/Speech/eSpeak-NG/speech.c
|
|
|
ce24cc |
|
|
|
ce24cc |
diff --git a/Documents/CONTRIBUTORS b/Documents/CONTRIBUTORS
|
|
|
ce24cc |
index 5a3af85b8..282ea193a 100644
|
|
|
ce24cc |
--- a/Documents/CONTRIBUTORS
|
|
|
ce24cc |
+++ b/Documents/CONTRIBUTORS
|
|
|
ce24cc |
@@ -50,6 +50,7 @@ Nikita Tseykovets <tseikovets@rambler.ru>
|
|
|
ce24cc |
Ole Guldberg <ole@omgwtf.dk>
|
|
|
ce24cc |
Olivier Bert <obert01@mistigri.org>
|
|
|
ce24cc |
Ollie Mallard <mallard@ilgerone.net>
|
|
|
ce24cc |
+olysonek
|
|
|
ce24cc |
Oscar Fernandez <ofa@once.es>
|
|
|
ce24cc |
Pete De Vasto <pdevasto@incyte.com>
|
|
|
ce24cc |
Peter Lundblad <plundblad@google.com>
|
|
|
ce24cc |
diff --git a/Documents/Manual-BRLTTY/English/driver-codes.sgml b/Documents/Manual-BRLTTY/English/driver-codes.sgml
|
|
|
ce24cc |
index 09eae4039..870cde7e3 100644
|
|
|
ce24cc |
--- a/Documents/Manual-BRLTTY/English/driver-codes.sgml
|
|
|
ce24cc |
+++ b/Documents/Manual-BRLTTY/English/driver-codes.sgml
|
|
|
ce24cc |
@@ -10,6 +10,7 @@ bm|Baum (Native, HT, PB1, PB2)@
|
|
|
ce24cc |
bn|BrailleNote@
|
|
|
ce24cc |
cb|CombiBraille@
|
|
|
ce24cc |
ec|EcoBraille@
|
|
|
ce24cc |
+en|eSpeak-NG@
|
|
|
ce24cc |
es|eSpeak@
|
|
|
ce24cc |
eu|EuroBraille@
|
|
|
ce24cc |
fl|FestivalLite@
|
|
|
ce24cc |
diff --git a/Documents/Manual-BRLTTY/English/speech-drivers.sgml b/Documents/Manual-BRLTTY/English/speech-drivers.sgml
|
|
|
ce24cc |
index 49caa060f..66c66e850 100644
|
|
|
ce24cc |
--- a/Documents/Manual-BRLTTY/English/speech-drivers.sgml
|
|
|
ce24cc |
+++ b/Documents/Manual-BRLTTY/English/speech-drivers.sgml
|
|
|
ce24cc |
@@ -8,6 +8,8 @@ CombiBraille
|
|
|
ce24cc |
|@
|
|
|
ce24cc |
eSpeak
|
|
|
ce24cc |
|text to speech engine@
|
|
|
ce24cc |
+eSpeak-NG
|
|
|
ce24cc |
+ |text to speech engine@
|
|
|
ce24cc |
ExternalSpeech
|
|
|
ce24cc |
|runs /usr/local/bin/externalspeech@
|
|
|
ce24cc |
Festival
|
|
|
ce24cc |
diff --git a/Documents/Manual-BRLTTY/French/driver-codes.sgml b/Documents/Manual-BRLTTY/French/driver-codes.sgml
|
|
|
ce24cc |
index 09eae4039..870cde7e3 100644
|
|
|
ce24cc |
--- a/Documents/Manual-BRLTTY/French/driver-codes.sgml
|
|
|
ce24cc |
+++ b/Documents/Manual-BRLTTY/French/driver-codes.sgml
|
|
|
ce24cc |
@@ -10,6 +10,7 @@ bm|Baum (Native, HT, PB1, PB2)@
|
|
|
ce24cc |
bn|BrailleNote@
|
|
|
ce24cc |
cb|CombiBraille@
|
|
|
ce24cc |
ec|EcoBraille@
|
|
|
ce24cc |
+en|eSpeak-NG@
|
|
|
ce24cc |
es|eSpeak@
|
|
|
ce24cc |
eu|EuroBraille@
|
|
|
ce24cc |
fl|FestivalLite@
|
|
|
ce24cc |
diff --git a/Documents/Manual-BRLTTY/French/speech-drivers.sgml b/Documents/Manual-BRLTTY/French/speech-drivers.sgml
|
|
|
ce24cc |
index 9d079b6c6..ede82d398 100644
|
|
|
ce24cc |
--- a/Documents/Manual-BRLTTY/French/speech-drivers.sgml
|
|
|
ce24cc |
+++ b/Documents/Manual-BRLTTY/French/speech-drivers.sgml
|
|
|
ce24cc |
@@ -6,6 +6,8 @@ CombiBraille
|
|
|
ce24cc |
|@
|
|
|
ce24cc |
eSpeak
|
|
|
ce24cc |
|text to speech engine@
|
|
|
ce24cc |
+eSpeak-NG
|
|
|
ce24cc |
+ |text to speech engine@
|
|
|
ce24cc |
ExternalSpeech
|
|
|
ce24cc |
|runs /usr/local/bin/externalspeech@
|
|
|
ce24cc |
Festival
|
|
|
ce24cc |
diff --git a/Documents/README.DOS b/Documents/README.DOS
|
|
|
ce24cc |
index eca9540ec..5b5de15c4 100644
|
|
|
ce24cc |
--- a/Documents/README.DOS
|
|
|
ce24cc |
+++ b/Documents/README.DOS
|
|
|
ce24cc |
@@ -285,8 +285,9 @@ You should be able to use a configure command like this one::
|
|
|
ce24cc |
--disable-api --disable-icu --disable-x \
|
|
|
ce24cc |
--without-usb-package --without-bluetooth-package \
|
|
|
ce24cc |
--without-libbraille --with-braille-driver=-vr,all \
|
|
|
ce24cc |
- --without-espeak --without-flite \
|
|
|
ce24cc |
- --without-speechd --with-speech-driver=all \
|
|
|
ce24cc |
+ --without-espeak --without-espeak-ng \
|
|
|
ce24cc |
+ --without-flite --without-speechd \
|
|
|
ce24cc |
+ --with-speech-driver=all \
|
|
|
ce24cc |
--with-screen-driver=pb,-all
|
|
|
ce24cc |
|
|
|
ce24cc |
The ``cfg-dos`` Script
|
|
|
ce24cc |
diff --git a/Documents/brltty.1.in b/Documents/brltty.1.in
|
|
|
ce24cc |
index ab7b3c1db..b95aaa964 100644
|
|
|
ce24cc |
--- a/Documents/brltty.1.in
|
|
|
ce24cc |
+++ b/Documents/brltty.1.in
|
|
|
ce24cc |
@@ -714,6 +714,9 @@ CombiBraille
|
|
|
ce24cc |
.B ec
|
|
|
ce24cc |
EcoBraille
|
|
|
ce24cc |
.TP 4
|
|
|
ce24cc |
+.B en
|
|
|
ce24cc |
+eSpeak-NG
|
|
|
ce24cc |
+.TP 4
|
|
|
ce24cc |
.B es
|
|
|
ce24cc |
eSpeak
|
|
|
ce24cc |
.TP 4
|
|
|
ce24cc |
diff --git a/Documents/brltty.conf.in b/Documents/brltty.conf.in
|
|
|
ce24cc |
index e11273674..80967177a 100644
|
|
|
ce24cc |
--- a/Documents/brltty.conf.in
|
|
|
ce24cc |
+++ b/Documents/brltty.conf.in
|
|
|
ce24cc |
@@ -343,6 +343,7 @@
|
|
|
ce24cc |
#speech-driver an # Android (text to speech engine)
|
|
|
ce24cc |
#speech-driver bl # BrailleLite
|
|
|
ce24cc |
#speech-driver cb # CombiBraille
|
|
|
ce24cc |
+#speech-driver en # eSpeak-NG (text to speech engine)
|
|
|
ce24cc |
#speech-driver es # eSpeak (text to speech engine)
|
|
|
ce24cc |
#speech-driver fl # FestivalLite (text to speech engine)
|
|
|
ce24cc |
#speech-driver fv # Festival (text to speech engine)
|
|
|
ce24cc |
@@ -383,6 +384,12 @@
|
|
|
ce24cc |
#speech-parameters es:PunctList=
|
|
|
ce24cc |
#speech-parameters es:Voice=default
|
|
|
ce24cc |
|
|
|
ce24cc |
+# eSpeak-NG Speech Driver Parameters
|
|
|
ce24cc |
+#speech-parameters en:MaxRate=450 # [80-]
|
|
|
ce24cc |
+#speech-parameters en:Path=
|
|
|
ce24cc |
+#speech-parameters en:PunctList=
|
|
|
ce24cc |
+#speech-parameters en:Voice=en
|
|
|
ce24cc |
+
|
|
|
ce24cc |
# ExternalSpeech Speech Driver Parameters
|
|
|
ce24cc |
#speech-parameters xs:Program=/usr/local/bin/externalspeech
|
|
|
ce24cc |
#speech-parameters xs:Uid=65534
|
|
|
ce24cc |
diff --git a/Documents/speech-driver.csv b/Documents/speech-driver.csv
|
|
|
ce24cc |
index 2e339a6bf..b56e85cbf 100644
|
|
|
ce24cc |
--- a/Documents/speech-driver.csv
|
|
|
ce24cc |
+++ b/Documents/speech-driver.csv
|
|
|
ce24cc |
@@ -4,6 +4,7 @@
|
|
|
ce24cc |
"bl","BrailleLite"
|
|
|
ce24cc |
"cb","CombiBraille"
|
|
|
ce24cc |
"es","eSpeak (text to speech engine)"
|
|
|
ce24cc |
+"en","eSpeak-NG (text to speech engine)"
|
|
|
ce24cc |
"fl","FestivalLite (text to speech engine)"
|
|
|
ce24cc |
"fv","Festival (text to speech engine)"
|
|
|
ce24cc |
"gs","GenericSay (pipes to /usr/local/bin/say)"
|
|
|
ce24cc |
diff --git a/Drivers/Speech/eSpeak-NG/Makefile.in b/Drivers/Speech/eSpeak-NG/Makefile.in
|
|
|
ce24cc |
new file mode 100644
|
|
|
ce24cc |
index 000000000..d91f9c59d
|
|
|
ce24cc |
--- /dev/null
|
|
|
ce24cc |
+++ b/Drivers/Speech/eSpeak-NG/Makefile.in
|
|
|
ce24cc |
@@ -0,0 +1,29 @@
|
|
|
ce24cc |
+###############################################################################
|
|
|
ce24cc |
+# BRLTTY - A background process providing access to the console screen (when in
|
|
|
ce24cc |
+# text mode) for a blind person using a refreshable braille display.
|
|
|
ce24cc |
+#
|
|
|
ce24cc |
+# Copyright (C) 1995-2018 by The BRLTTY Developers.
|
|
|
ce24cc |
+#
|
|
|
ce24cc |
+# BRLTTY comes with ABSOLUTELY NO WARRANTY.
|
|
|
ce24cc |
+#
|
|
|
ce24cc |
+# This is free software, placed under the terms of the
|
|
|
ce24cc |
+# GNU Lesser General Public License, as published by the Free Software
|
|
|
ce24cc |
+# Foundation; either version 2.1 of the License, or (at your option) any
|
|
|
ce24cc |
+# later version. Please see the file LICENSE-LGPL for details.
|
|
|
ce24cc |
+#
|
|
|
ce24cc |
+# Web Page: http://brltty.com/
|
|
|
ce24cc |
+#
|
|
|
ce24cc |
+# This software is maintained by Dave Mielke <dave@mielke.cc>.
|
|
|
ce24cc |
+###############################################################################
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+DRIVER_CODE = en
|
|
|
ce24cc |
+DRIVER_NAME = eSpeak-NG
|
|
|
ce24cc |
+DRIVER_COMMENT = text to speech engine
|
|
|
ce24cc |
+DRIVER_VERSION = 0.1
|
|
|
ce24cc |
+DRIVER_DEVELOPERS = Nicolas Pitre <nico@fluxnic.net>, Ondřej Lysoněk <olysonek@redhat.com>
|
|
|
ce24cc |
+SPK_OBJS = @speech_libraries_en@
|
|
|
ce24cc |
+include $(SRC_TOP)speech.mk
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+speech.$O:
|
|
|
ce24cc |
+ $(CC) $(SPK_CFLAGS) -I$(ESPEAK_NG_ROOT)/include -c $(SRC_DIR)/speech.c
|
|
|
ce24cc |
+
|
|
|
ce24cc |
diff --git a/Drivers/Speech/eSpeak-NG/README b/Drivers/Speech/eSpeak-NG/README
|
|
|
ce24cc |
new file mode 100644
|
|
|
ce24cc |
index 000000000..825848aa0
|
|
|
ce24cc |
--- /dev/null
|
|
|
ce24cc |
+++ b/Drivers/Speech/eSpeak-NG/README
|
|
|
ce24cc |
@@ -0,0 +1,34 @@
|
|
|
ce24cc |
+This directory contains the BRLTTY speech driver for the eSpeak-NG text to
|
|
|
ce24cc |
+speech engine. The eSpeak-NG web site is
|
|
|
ce24cc |
+https://github.com/espeak-ng/espeak-ng/.
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+eSpeak-NG comes with a simple command-line tool called espeak-ng which can be
|
|
|
ce24cc |
+used to test it, and to recompile modified dictionaries, etc. Please see
|
|
|
ce24cc |
+the espeak-ng man page for more information.
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+BRLTTY's configure script automatically includes this driver if the
|
|
|
ce24cc |
+eSpeak-NG development library is installed.
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+This driver recognizes the following parameters:
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+path
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+ Specifies the directory containing the espeak-ng-data directory.
|
|
|
ce24cc |
+ If not specified, the default location is used.
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+punctlist
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+ Specified a list of punctuation characters whose names are to be
|
|
|
ce24cc |
+ spoken when the speech punctuation parameter is set to "Some".
|
|
|
ce24cc |
+ If not specified, a default list is used.
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+voice
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+ Specifies a voice/language to use. The complete list of available
|
|
|
ce24cc |
+ voices may be obtained with the command 'espeak-ng --voices'.
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+maxrate
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+ Overrides the maximum speech rate value. The default is 450.
|
|
|
ce24cc |
+ This cannot be lower than 80.
|
|
|
ce24cc |
+
|
|
|
ce24cc |
diff --git a/Drivers/Speech/eSpeak-NG/speech.c b/Drivers/Speech/eSpeak-NG/speech.c
|
|
|
ce24cc |
new file mode 100644
|
|
|
ce24cc |
index 000000000..af918c971
|
|
|
ce24cc |
--- /dev/null
|
|
|
ce24cc |
+++ b/Drivers/Speech/eSpeak-NG/speech.c
|
|
|
ce24cc |
@@ -0,0 +1,174 @@
|
|
|
ce24cc |
+/*
|
|
|
ce24cc |
+ * BRLTTY - A background process providing access to the console screen (when in
|
|
|
ce24cc |
+ * text mode) for a blind person using a refreshable braille display.
|
|
|
ce24cc |
+ *
|
|
|
ce24cc |
+ * Copyright (C) 1995-2018 by The BRLTTY Developers.
|
|
|
ce24cc |
+ *
|
|
|
ce24cc |
+ * BRLTTY comes with ABSOLUTELY NO WARRANTY.
|
|
|
ce24cc |
+ *
|
|
|
ce24cc |
+ * This is free software, placed under the terms of the
|
|
|
ce24cc |
+ * GNU Lesser General Public License, as published by the Free Software
|
|
|
ce24cc |
+ * Foundation; either version 2.1 of the License, or (at your option) any
|
|
|
ce24cc |
+ * later version. Please see the file LICENSE-LGPL for details.
|
|
|
ce24cc |
+ *
|
|
|
ce24cc |
+ * Web Page: http://brltty.com/
|
|
|
ce24cc |
+ *
|
|
|
ce24cc |
+ * This software is maintained by Dave Mielke <dave@mielke.cc>.
|
|
|
ce24cc |
+ */
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+#include "prologue.h"
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+#include <stdio.h>
|
|
|
ce24cc |
+#include <stdlib.h>
|
|
|
ce24cc |
+#include <string.h>
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+#include "log.h"
|
|
|
ce24cc |
+#include "parse.h"
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+typedef enum {
|
|
|
ce24cc |
+ PARM_PATH,
|
|
|
ce24cc |
+ PARM_PUNCTLIST,
|
|
|
ce24cc |
+ PARM_VOICE,
|
|
|
ce24cc |
+ PARM_MAXRATE
|
|
|
ce24cc |
+} DriverParameter;
|
|
|
ce24cc |
+#define SPKPARMS "path", "punctlist", "voice", "maxrate"
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+#include "spk_driver.h"
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+#include <espeak-ng/speak_lib.h>
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+static int maxrate = espeakRATE_MAXIMUM;
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+static void
|
|
|
ce24cc |
+spk_say(volatile SpeechSynthesizer *spk, const unsigned char *buffer, size_t length, size_t count, const unsigned char *attributes)
|
|
|
ce24cc |
+{
|
|
|
ce24cc |
+ int result;
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+ /* add 1 to the length in order to pass along the trailing zero */
|
|
|
ce24cc |
+ result = espeak_Synth(buffer, length+1, 0, POS_CHARACTER, 0,
|
|
|
ce24cc |
+ espeakCHARS_UTF8, NULL, (void *)spk);
|
|
|
ce24cc |
+ if (result != EE_OK)
|
|
|
ce24cc |
+ logMessage(LOG_ERR, "eSpeak-NG: Synth() returned error %d", result);
|
|
|
ce24cc |
+}
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+static void
|
|
|
ce24cc |
+spk_mute(volatile SpeechSynthesizer *spk)
|
|
|
ce24cc |
+{
|
|
|
ce24cc |
+ espeak_Cancel();
|
|
|
ce24cc |
+}
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+static int SynthCallback(short *audio, int numsamples, espeak_EVENT *events)
|
|
|
ce24cc |
+{
|
|
|
ce24cc |
+ volatile SpeechSynthesizer *spk = events->user_data;
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+ while (events->type != espeakEVENT_LIST_TERMINATED) {
|
|
|
ce24cc |
+ if (events->type == espeakEVENT_WORD)
|
|
|
ce24cc |
+ tellSpeechLocation(spk, events->text_position - 1);
|
|
|
ce24cc |
+ if (events->type == espeakEVENT_MSG_TERMINATED)
|
|
|
ce24cc |
+ tellSpeechFinished(spk);
|
|
|
ce24cc |
+ events++;
|
|
|
ce24cc |
+ }
|
|
|
ce24cc |
+ return 0;
|
|
|
ce24cc |
+}
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+static void
|
|
|
ce24cc |
+spk_drain(volatile SpeechSynthesizer *spk)
|
|
|
ce24cc |
+{
|
|
|
ce24cc |
+ espeak_Synchronize();
|
|
|
ce24cc |
+}
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+static void
|
|
|
ce24cc |
+spk_setVolume(volatile SpeechSynthesizer *spk, unsigned char setting)
|
|
|
ce24cc |
+{
|
|
|
ce24cc |
+ int volume = getIntegerSpeechVolume(setting, 50);
|
|
|
ce24cc |
+ espeak_SetParameter(espeakVOLUME, volume, 0);
|
|
|
ce24cc |
+}
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+static void
|
|
|
ce24cc |
+spk_setRate(volatile SpeechSynthesizer *spk, unsigned char setting)
|
|
|
ce24cc |
+{
|
|
|
ce24cc |
+ int h_range = (maxrate - espeakRATE_MINIMUM)/2;
|
|
|
ce24cc |
+ int rate = getIntegerSpeechRate(setting, h_range) + espeakRATE_MINIMUM;
|
|
|
ce24cc |
+ espeak_SetParameter(espeakRATE, rate, 0);
|
|
|
ce24cc |
+}
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+static void
|
|
|
ce24cc |
+spk_setPitch(volatile SpeechSynthesizer *spk, unsigned char setting)
|
|
|
ce24cc |
+{
|
|
|
ce24cc |
+ int pitch = getIntegerSpeechPitch(setting, 50);
|
|
|
ce24cc |
+ espeak_SetParameter(espeakPITCH, pitch, 0);
|
|
|
ce24cc |
+}
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+static void
|
|
|
ce24cc |
+spk_setPunctuation(volatile SpeechSynthesizer *spk, SpeechPunctuation setting)
|
|
|
ce24cc |
+{
|
|
|
ce24cc |
+ espeak_PUNCT_TYPE punct;
|
|
|
ce24cc |
+ if (setting <= SPK_PUNCTUATION_NONE)
|
|
|
ce24cc |
+ punct = espeakPUNCT_NONE;
|
|
|
ce24cc |
+ else if (setting >= SPK_PUNCTUATION_ALL)
|
|
|
ce24cc |
+ punct = espeakPUNCT_ALL;
|
|
|
ce24cc |
+ else
|
|
|
ce24cc |
+ punct = espeakPUNCT_SOME;
|
|
|
ce24cc |
+ espeak_SetParameter(espeakPUNCTUATION, punct, 0);
|
|
|
ce24cc |
+}
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+static int spk_construct(volatile SpeechSynthesizer *spk, char **parameters)
|
|
|
ce24cc |
+{
|
|
|
ce24cc |
+ char *data_path, *voicename, *punctlist;
|
|
|
ce24cc |
+ int result;
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+ spk->setVolume = spk_setVolume;
|
|
|
ce24cc |
+ spk->setRate = spk_setRate;
|
|
|
ce24cc |
+ spk->setPitch = spk_setPitch;
|
|
|
ce24cc |
+ spk->setPunctuation = spk_setPunctuation;
|
|
|
ce24cc |
+ spk->drain = spk_drain;
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+ logMessage(LOG_INFO, "eSpeak-NG version %s", espeak_Info(NULL));
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+ data_path = parameters[PARM_PATH];
|
|
|
ce24cc |
+ if (data_path && !*data_path)
|
|
|
ce24cc |
+ data_path = NULL;
|
|
|
ce24cc |
+ result = espeak_Initialize(AUDIO_OUTPUT_PLAYBACK, 0, data_path, 0);
|
|
|
ce24cc |
+ if (result < 0) {
|
|
|
ce24cc |
+ logMessage(LOG_ERR, "eSpeak-NG: initialization failed");
|
|
|
ce24cc |
+ return 0;
|
|
|
ce24cc |
+ }
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+ voicename = parameters[PARM_VOICE];
|
|
|
ce24cc |
+ if(!voicename || !*voicename)
|
|
|
ce24cc |
+ voicename = "en";
|
|
|
ce24cc |
+ result = espeak_SetVoiceByName(voicename);
|
|
|
ce24cc |
+ if (result != EE_OK) {
|
|
|
ce24cc |
+ espeak_VOICE voice_select;
|
|
|
ce24cc |
+ memset(&voice_select, 0, sizeof(voice_select));
|
|
|
ce24cc |
+ voice_select.languages = voicename;
|
|
|
ce24cc |
+ result = espeak_SetVoiceByProperties(&voice_select);
|
|
|
ce24cc |
+ }
|
|
|
ce24cc |
+ if (result != EE_OK) {
|
|
|
ce24cc |
+ logMessage(LOG_ERR, "eSpeak-NG: unable to load voice '%s'", voicename);
|
|
|
ce24cc |
+ return 0;
|
|
|
ce24cc |
+ }
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+ punctlist = parameters[PARM_PUNCTLIST];
|
|
|
ce24cc |
+ if (punctlist && *punctlist) {
|
|
|
ce24cc |
+ wchar_t w_punctlist[strlen(punctlist) + 1];
|
|
|
ce24cc |
+ int i = 0;
|
|
|
ce24cc |
+ while ((w_punctlist[i] = punctlist[i]) != 0) i++;
|
|
|
ce24cc |
+ espeak_SetPunctuationList(w_punctlist);
|
|
|
ce24cc |
+ }
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+ if (parameters[PARM_MAXRATE]) {
|
|
|
ce24cc |
+ int val = atoi(parameters[PARM_MAXRATE]);
|
|
|
ce24cc |
+ if (val > espeakRATE_MINIMUM) maxrate = val;
|
|
|
ce24cc |
+ }
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+ espeak_SetSynthCallback(SynthCallback);
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+ return 1;
|
|
|
ce24cc |
+}
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+static void spk_destruct(volatile SpeechSynthesizer *spk)
|
|
|
ce24cc |
+{
|
|
|
ce24cc |
+ espeak_Cancel();
|
|
|
ce24cc |
+ espeak_Terminate();
|
|
|
ce24cc |
+}
|
|
|
ce24cc |
diff --git a/README b/README
|
|
|
ce24cc |
index 5fcd8c221..9fd946eb5 100644
|
|
|
ce24cc |
--- a/README
|
|
|
ce24cc |
+++ b/README
|
|
|
ce24cc |
@@ -210,6 +210,7 @@ The following speech synthesizers are supported:
|
|
|
ce24cc |
- BrailleLite
|
|
|
ce24cc |
- CombiBraille
|
|
|
ce24cc |
- eSpeak [text to speech engine]
|
|
|
ce24cc |
+- eSpeak-NG [text to speech engine]
|
|
|
ce24cc |
- ExternalSpeech [runs /usr/local/bin/externalspeech]
|
|
|
ce24cc |
- Festival [text to speech engine]
|
|
|
ce24cc |
- FestivalLite [text to speech engine]
|
|
|
ce24cc |
diff --git a/brltty.spec.in b/brltty.spec.in
|
|
|
ce24cc |
index 8a4986c5d..f5aa33dc2 100644
|
|
|
ce24cc |
--- a/brltty.spec.in
|
|
|
ce24cc |
+++ b/brltty.spec.in
|
|
|
ce24cc |
@@ -144,6 +144,27 @@ Install this package if you would like to be able to use the
|
|
|
ce24cc |
eSpeak text-to-speech engine.
|
|
|
ce24cc |
|
|
|
ce24cc |
|
|
|
ce24cc |
+%package -n brltty-speech-espeak-ng
|
|
|
ce24cc |
+Version: @PACKAGE_VERSION@
|
|
|
ce24cc |
+Release: 1
|
|
|
ce24cc |
+Group: System Environment/Daemons
|
|
|
ce24cc |
+License: GPL
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+Requires: espeak-ng
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+BuildRequires: espeak-ng-devel
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+AutoProv: no
|
|
|
ce24cc |
+AutoReq: yes
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+Summary: eSpeak-NG speech driver for BRLTTY.
|
|
|
ce24cc |
+%description -n brltty-speech-espeak-ng
|
|
|
ce24cc |
+This package provides the eSpeak-NG speech driver for BRLTTY.
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+Install this package if you would like to be able to use the
|
|
|
ce24cc |
+eSpeak-NG text-to-speech engine.
|
|
|
ce24cc |
+
|
|
|
ce24cc |
+
|
|
|
ce24cc |
%package -n brltty-speech-festival
|
|
|
ce24cc |
Version: @PACKAGE_VERSION@
|
|
|
ce24cc |
Release: 1
|
|
|
ce24cc |
@@ -512,6 +533,7 @@ rm -fr "${RPM_BUILD_ROOT}"
|
|
|
ce24cc |
%{_libdir}/brltty
|
|
|
ce24cc |
%exclude %{_libdir}/brltty/libbrlttybba.so
|
|
|
ce24cc |
%exclude %{_libdir}/brltty/libbrlttybxw.so
|
|
|
ce24cc |
+%exclude %{_libdir}/brltty/libbrlttysen.so
|
|
|
ce24cc |
%exclude %{_libdir}/brltty/libbrlttyses.so
|
|
|
ce24cc |
%exclude %{_libdir}/brltty/libbrlttysfl.so
|
|
|
ce24cc |
%exclude %{_libdir}/brltty/libbrlttysfv.so
|
|
|
ce24cc |
@@ -541,6 +563,9 @@ rm -fr "${RPM_BUILD_ROOT}"
|
|
|
ce24cc |
%files -n brltty-speech-espeak
|
|
|
ce24cc |
%{_libdir}/brltty/libbrlttyses.so
|
|
|
ce24cc |
|
|
|
ce24cc |
+%files -n brltty-speech-espeak-ng
|
|
|
ce24cc |
+%{_libdir}/brltty/libbrlttysen.so
|
|
|
ce24cc |
+
|
|
|
ce24cc |
%files -n brltty-speech-festival
|
|
|
ce24cc |
%{_libdir}/brltty/libbrlttysfv.so
|
|
|
ce24cc |
|
|
|
ce24cc |
diff --git a/cfg-android b/cfg-android
|
|
|
ce24cc |
index 1c9ad3e14..db83a28a6 100755
|
|
|
ce24cc |
--- a/cfg-android
|
|
|
ce24cc |
+++ b/cfg-android
|
|
|
ce24cc |
@@ -89,6 +89,7 @@ export LDFLAGS="-Wl,--fix-cortex-a8"
|
|
|
ce24cc |
--with-braille-driver=-ba,-bg,-tt,-vr,al,at,bm,bn,ce,eu,fs,hm,ht,hw,ic,ir,md,mm,mt,np,pg,pm,sk,vo \
|
|
|
ce24cc |
\
|
|
|
ce24cc |
--without-espeak \
|
|
|
ce24cc |
+ --without-espeak-ng \
|
|
|
ce24cc |
--without-flite \
|
|
|
ce24cc |
--without-mikropuhe \
|
|
|
ce24cc |
--without-speechd \
|
|
|
ce24cc |
diff --git a/cfg-darwin b/cfg-darwin
|
|
|
ce24cc |
index 13741c371..992292717 100755
|
|
|
ce24cc |
--- a/cfg-darwin
|
|
|
ce24cc |
+++ b/cfg-darwin
|
|
|
ce24cc |
@@ -25,6 +25,7 @@
|
|
|
ce24cc |
--without-libbraille \
|
|
|
ce24cc |
\
|
|
|
ce24cc |
--without-espeak \
|
|
|
ce24cc |
+ --without-espeak-ng \
|
|
|
ce24cc |
--without-flite \
|
|
|
ce24cc |
--without-mikropuhe \
|
|
|
ce24cc |
--without-speechd \
|
|
|
ce24cc |
diff --git a/cfg-dos b/cfg-dos
|
|
|
ce24cc |
index 82277980b..55427b7b2 100755
|
|
|
ce24cc |
--- a/cfg-dos
|
|
|
ce24cc |
+++ b/cfg-dos
|
|
|
ce24cc |
@@ -57,6 +57,7 @@ export LDFLAGS=""
|
|
|
ce24cc |
--with-braille-driver=-vr,all \
|
|
|
ce24cc |
\
|
|
|
ce24cc |
--without-espeak \
|
|
|
ce24cc |
+ --without-espeak-ng \
|
|
|
ce24cc |
--without-flite \
|
|
|
ce24cc |
--without-mikropuhe \
|
|
|
ce24cc |
--without-speechd \
|
|
|
ce24cc |
diff --git a/config.mk.in b/config.mk.in
|
|
|
ce24cc |
index ead6ca348..89af949de 100644
|
|
|
ce24cc |
--- a/config.mk.in
|
|
|
ce24cc |
+++ b/config.mk.in
|
|
|
ce24cc |
@@ -370,6 +370,7 @@ SCREEN_DRIVER_LIBRARIES = @screen_driver_libraries@
|
|
|
ce24cc |
SCREEN_DRIVERS = @screen_drivers@
|
|
|
ce24cc |
|
|
|
ce24cc |
ESPEAK_ROOT = @espeak_root@
|
|
|
ce24cc |
+ESPEAK_NG_ROOT = @espeak_ng_root@
|
|
|
ce24cc |
FLITE_ROOT = @flite_root@
|
|
|
ce24cc |
FLITE_LANGUAGE = @flite_language@
|
|
|
ce24cc |
FLITE_LEXICON = @flite_lexicon@
|
|
|
ce24cc |
diff --git a/configure.ac b/configure.ac
|
|
|
ce24cc |
index 39eb98390..b86f85209 100644
|
|
|
ce24cc |
--- a/configure.ac
|
|
|
ce24cc |
+++ b/configure.ac
|
|
|
ce24cc |
@@ -1742,6 +1742,10 @@ BRLTTY_ARG_DISABLE(
|
|
|
ce24cc |
BRLTTY_SPEECH_DRIVER([bl], [BrailleLite])
|
|
|
ce24cc |
BRLTTY_SPEECH_DRIVER([cb], [CombiBraille])
|
|
|
ce24cc |
|
|
|
ce24cc |
+ BRLTTY_IF_PACKAGE([eSpeak-NG], [espeak_ng], [include/espeak-ng/speak_lib.h], [dnl
|
|
|
ce24cc |
+ BRLTTY_SPEECH_DRIVER([en], [eSpeak-NG], [-L$(ESPEAK_NG_ROOT)/lib -lespeak-ng])
|
|
|
ce24cc |
+ ])
|
|
|
ce24cc |
+
|
|
|
ce24cc |
BRLTTY_IF_PACKAGE([eSpeak], [espeak], [include/espeak/speak_lib.h], [dnl
|
|
|
ce24cc |
BRLTTY_SPEECH_DRIVER([es], [eSpeak], [-L$(ESPEAK_ROOT)/lib -lespeak])
|
|
|
ce24cc |
])
|
|
|
ce24cc |
--
|
|
|
ce24cc |
2.14.3
|
|
|
ce24cc |
|