From a468f96858c1b42a53fec2d83f3dccff626aa5f8 Mon Sep 17 00:00:00 2001 From: Philip Schell Date: Wed, 23 Oct 2013 09:37:13 +0000 Subject: Bugfix in WinterSpeak with SAPI4 Voice git-svn-id: http://svn.miranda-ng.org/main/trunk@6598 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/WinterSpeak/WinterSpeak_11.vcxproj | 2 +- plugins/WinterSpeak/src/SpeechApi40a.cpp | 13 ++++++------- plugins/WinterSpeak/src/Version.h | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) (limited to 'plugins/WinterSpeak') diff --git a/plugins/WinterSpeak/WinterSpeak_11.vcxproj b/plugins/WinterSpeak/WinterSpeak_11.vcxproj index b65b726e9c..8ca7977d7b 100644 --- a/plugins/WinterSpeak/WinterSpeak_11.vcxproj +++ b/plugins/WinterSpeak/WinterSpeak_11.vcxproj @@ -20,7 +20,7 @@ WinterSpeak - {A44F96D0-A850-4A67-9570-0E9298A16E40} + {18195F68-A747-8643-050C-C5101DA658FD} diff --git a/plugins/WinterSpeak/src/SpeechApi40a.cpp b/plugins/WinterSpeak/src/SpeechApi40a.cpp index ab15e3e6bc..5e6bbebe2c 100644 --- a/plugins/WinterSpeak/src/SpeechApi40a.cpp +++ b/plugins/WinterSpeak/src/SpeechApi40a.cpp @@ -57,7 +57,6 @@ bool SpeechApi40a::load() { return true; } - return loadWithVoice(std::wstring(m_voice)); } @@ -77,7 +76,6 @@ bool SpeechApi40a::unload() } m_state = TextToSpeech::State_Unloaded; - return true; } @@ -90,7 +88,8 @@ bool SpeechApi40a::isLoaded() const //------------------------------------------------------------------------------ bool SpeechApi40a::say(const std::wstring &sentence) { - std::string text = mir_t2a_cp(sentence.c_str(), CP_UTF8); + //std::string text = mir_t2a_cp(sentence.c_str(), CP_ACP); + //MessageBoxA(NULL, text.c_str(), "TTS4", MB_OK); bool ret = true; if (!isLoaded()) @@ -100,8 +99,8 @@ bool SpeechApi40a::say(const std::wstring &sentence) else { SDATA data; - data.dwSize = (DWORD)text.size(); - data.pData = (char *)text.c_str(); + data.dwSize = (DWORD)(sentence.size() * sizeof(WCHAR)); + data.pData = (WCHAR *)sentence.c_str(); m_tts_central->TextData(CHARSET_TEXT, 0, data, NULL, IID_ITTSBufNotifySinkA); } @@ -175,7 +174,7 @@ bool SpeechApi40a::setVoice(const std::wstring &voice) std::vector SpeechApi40a::getVoices() const { std::vector ret; - + PITTSENUM pITTSEnum = NULL; TTSMODEINFO inf; @@ -222,7 +221,7 @@ std::wstring SpeechApi40a::getDescription() bool SpeechApi40a::loadWithVoice(std::wstring &voice) { CoInitialize(NULL); - + PITTSENUM pITTSEnum; TTSMODEINFO inf; LPUNKNOWN pAudioDest; diff --git a/plugins/WinterSpeak/src/Version.h b/plugins/WinterSpeak/src/Version.h index 22152c74d0..413358c17d 100644 --- a/plugins/WinterSpeak/src/Version.h +++ b/plugins/WinterSpeak/src/Version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 9 #define __RELEASE_NUM 8 -#define __BUILD_NUM 2 +#define __BUILD_NUM 3 #define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM -- cgit v1.2.3