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

Patch: Fixing an issue with the Mac speech server and UTF-8 characters



Hi,
A few weeks ago, I noticed a bug in the Mac speech server with words like protégé. I got in touch with David Tseng, and he kindly provided this patch. I have been using it for a while now, and everything is working perfectly. I'm providing it here so that it can be merged into Emacspeak:
diff --git a/servers/mac b/servers/mac
index 85e838b25..476bff38d 100755
--- a/servers/mac
+++ b/servers/mac
@@ -296,7 +296,7 @@ class _ProtocolHandler:
     output = prefix + " " + output + " " + suffix
     writeDebugLog(4, "about to speak letter: " + output + "\n")
     # Send directly to TTS to avoid any line processing.
-    speechSynthesizer.startSpeakingString_(output)
+    speechSynthesizer.startSpeakingString_(unicode(output, "utf-8"))
 
   def handleQueue(self, args):
     parseContent(args)
@@ -544,7 +544,7 @@ def processSpeechQueue():
       output = item[1].strip(" {}")
       if output:
         speechSynthesizer.setRate_(ttsState['speechRate'])
-        speechSynthesizer.startSpeakingString_(output)
+        speechSynthesizer.startSpeakingString_(unicode(output, "utf-8"))
         writeDebugLog(2, "\nsay: " + output + "\nend\n")
       else:
         processSpeechQueue()
@@ -573,7 +573,7 @@ def processSpeechQueue():
       writeDebugLog(4, "rendering text clip" + str(output))
       speechSynthesizer.setRate_(ttsState['speechRate'])
       if not enableSox:
-        speechSynthesizer.startSpeakingString_(output)
+        speechSynthesizer.startSpeakingString_(unicode(output, "utf-8"))
       else:
         if speechSynthesizer.startSpeakingString_toURL_(
 output, speechOutUrl) and output not in renderingBlacklist:


|May 1995 - Last Year |Current Year|


If you have questions about this archive or had problems using it, please contact us.

Contact Info Page