CBL-Mariner/SPECS/espeakup/speaking-spaces.patch

32 lines
1.0 KiB
Diff

From a5b655ddb066eb5915117452f62937b2a9bf3256 Mon Sep 17 00:00:00 2001
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Tue, 14 Mar 2017 21:56:31 -0500
Subject: [PATCH] fix speaking spaces
Espeak doesn't speak spaces unless it is specifically told to do so.
---
espeak.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/espeak.c b/espeak.c
index f09d3c4..f1f8064 100644
--- a/espeak.c
+++ b/espeak.c
@@ -170,9 +170,13 @@ static espeak_ERROR speak_text(struct synth_t *s)
if (espeakup_mode == ESPEAKUP_MODE_SPEAKUP && (s->len == 1)) {
char *buf;
int n;
- n = asprintf(&buf,
- "<say-as interpret-as=\"characters\">%c</say-as>",
- s->buf[0]);
+ if (s->buf[0] == ' ')
+ n = asprintf(&buf,
+ "<say-as interpret-as=\"tts:char\">&#32;</say-as>");
+ else
+ n = asprintf(&buf,
+ "<say-as interpret-as=\"characters\">%c</say-as>",
+ s->buf[0]);
if (n == -1) {
/* D'oh. Not much to do on allocation failure.
* Perhaps espeak will happen to say the character */