From 8e4a24f55e2986de6c0556ab1a0faeeca20c724f Mon Sep 17 00:00:00 2001 From: Jaromir Wysoglad Date: Thu, 18 Jul 2019 00:48:01 +0200 Subject: TTS: Unify setters between linux and win backends. --- backends/text-to-speech/windows/windows-text-to-speech.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 6f621ed5d6..f688ec1cd5 100644 --- a/backends/text-to-speech/windows/windows-text-to-speech.cpp +++ b/backends/text-to-speech/windows/windows-text-to-speech.cpp @@ -103,7 +103,7 @@ bool WindowsTextToSpeechManager::say(Common::String str) { _audio->SetState(SPAS_STOP, 0); _audio->SetState(SPAS_RUN, 0); // We have to set the pitch by prepending xml code at the start of the said string; - Common::String pitch= Common::String::format("", _ttsState->_pitch); + Common::String pitch= Common::String::format("", _ttsState->_pitch / 10); str.replace((uint32)0, 0, pitch); WCHAR *strW = Win32::ansiToUnicode(str.c_str()); @@ -178,14 +178,15 @@ void WindowsTextToSpeechManager::setVoice(unsigned index) { void WindowsTextToSpeechManager::setRate(int rate) { if(_speechState == BROKEN || _speechState == NO_VOICE) return; - assert(rate >= -10 && rate <= 10); - _voice->SetRate(rate); + assert(rate >= -100 && rate <= 100); + _voice->SetRate(rate / 10); _ttsState->_rate = rate; } void WindowsTextToSpeechManager::setPitch(int pitch) { if(_speechState == BROKEN || _speechState == NO_VOICE) return; + assert(pitch >= -100 && pitch <= 100); _ttsState->_pitch = pitch; } -- cgit v1.2.3