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

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