[Scummvm-git-logs] scummvm master -> c67fd1b63ac93aba243daf184d5d1d3af7de8e6a

Mataniko mataniko at gmail.com
Sun Mar 28 18:07:46 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c67fd1b63a TTS: Fix UI lag when TTS is turned on in Windows


Commit: c67fd1b63ac93aba243daf184d5d1d3af7de8e6a
    https://github.com/scummvm/scummvm/commit/c67fd1b63ac93aba243daf184d5d1d3af7de8e6a
Author: mataniko (mataniko at gmail.com)
Date: 2021-03-28T14:07:36-04:00

Commit Message:
TTS: Fix UI lag when TTS is turned on in Windows

Without specifying the XML format, SAPI throws a hidden exception that stalls the GUI every time we use TTS

Changed paths:
    backends/text-to-speech/windows/windows-text-to-speech.cpp


diff --git a/backends/text-to-speech/windows/windows-text-to-speech.cpp b/backends/text-to-speech/windows/windows-text-to-speech.cpp
index d9599d1575..36a620974d 100644
--- a/backends/text-to-speech/windows/windows-text-to-speech.cpp
+++ b/backends/text-to-speech/windows/windows-text-to-speech.cpp
@@ -150,7 +150,7 @@ DWORD WINAPI startSpeech(LPVOID parameters) {
 			break;
 		}
 		WCHAR *currentSpeech = params->queue->front();
-		_voice->Speak(currentSpeech, SPF_PURGEBEFORESPEAK | SPF_ASYNC, 0);
+		_voice->Speak(currentSpeech, SPF_PURGEBEFORESPEAK | SPF_ASYNC | SPF_PARSE_SAPI, 0);
 		ReleaseMutex(*params->mutex);
 
 		while (*(params->state) != WindowsTextToSpeechManager::PAUSED)
@@ -183,7 +183,7 @@ bool WindowsTextToSpeechManager::say(const Common::U32String &str, Action action
 		return true;
 
 	// We have to set the pitch by prepending xml code at the start of the said string;
-	Common::U32String pitch = Common::U32String::format("<pitch absmiddle=\"%d\">%S", _ttsState->_pitch / 10, str.c_str());
+	Common::U32String pitch = Common::U32String::format("<pitch absmiddle=\"%d\"/>%S", _ttsState->_pitch / 10, str.c_str());
 	WCHAR *strW = (WCHAR *) pitch.encodeUTF16Native();
 	if (strW == nullptr) {
 		warning("Cannot convert from UTF-32 encoding for text to speech");




More information about the Scummvm-git-logs mailing list