Blame SOURCES/0001-Add-support-for-eSpeak-NG.patch

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