[PATCH] speakup: Fix spurious space pronunciation on spelling letters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This gathers emitting the caps start string, space, spelled letter
string, space, and caps stop string, into one printf, to avoid
sending to the synth a space character alone, which the synth would
then pronounce.

Similarly, emit space along control-letter and letter spelling.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
Tested-by: Zahari Yurukov <zahari.yurukov@xxxxxxxxx>

Index: linux-4.10/drivers/staging/speakup/main.c
===================================================================
--- linux-4.10.orig/drivers/staging/speakup/main.c
+++ linux-4.10/drivers/staging/speakup/main.c
@@ -448,20 +448,17 @@ static void speak_char(u16 ch)
 		pr_info("speak_char: cp == NULL!\n");
 		return;
 	}
-	synth_buffer_add(SPACE);
 	if (IS_CHAR(ch, B_CAP)) {
 		spk_pitch_shift++;
-		synth_printf("%s", spk_str_caps_start);
-		synth_printf("%s", cp);
-		synth_printf("%s", spk_str_caps_stop);
+		synth_printf("%s %s %s",
+			     spk_str_caps_start, cp, spk_str_caps_stop);
 	} else {
 		if (*cp == '^') {
-			synth_printf("%s", spk_msg_get(MSG_CTRL));
 			cp++;
-		}
-		synth_printf("%s", cp);
+			synth_printf(" %s%s ", spk_msg_get(MSG_CTRL), cp);
+		} else
+			synth_printf(" %s ", cp);
 	}
-	synth_buffer_add(SPACE);
 }
 
 static u16 get_char(struct vc_data *vc, u16 *pos, u_char *attribs)

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux